question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for `console.log`

See original GitHub issue

Overview

Brownie should support console.log as implemented by Buidler

Specification

  1. Access to the functionality comes from an import: import "@nomiclabs/buidler/console.sol";
  2. The imported contract is available at: nomiclabs/buidler/packages/buidler-core/console.sol
  3. console is a library. log sends a call to an empty account with a particular signature depending on the param type(s) given. It will be possible to extract these from the debug_traceTransaction output.

Considerations

  1. How to handle importing console.sol without reliance on NPM? The solution will likely require expanding the brownie package manager.
  2. The implementation must produce consistent results with buidler. Should examine their test cases around this and write similar ones for Brownie.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:19
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
anticlimacticcommented, Feb 22, 2022

how about now? because it looks like #1043 has been merged. @iamdefinitelyahuman

2reactions
zmeghjicommented, Jun 2, 2022

Emitting events with the data you want to log could be an alternative if you don’t want to use hardhat: https://permanentiteration.com/console-log-alternative-for-brownie/

Read more comments on GitHub >

github_iconTop Results From Across the Web

console.log() - Web APIs - MDN Web Docs
The console.log() method outputs a message to the web console. The message may be a single string (with optional substitution values), ...
Read more >
Let's extend console.log() - JavaScript in Plain English
It lets you output strings, arrays, and objects that help debug your code. The console is part of the window object, and is...
Read more >
JavaScript Console.log() Example – How to Print to the ...
Just open the console, Ctrl+Shift+K or F12 , and in the top right you will see a button that says "Switch to multi-line...
Read more >
Saving Browser Console Logs for Support
With a Chrome browser window open, hit the F12 button (usually located at the top of the keyboard above the Backspace key). ·...
Read more >
JavaScript console.log() Method - W3Schools
Console log () · Definition and Usage · Note · Syntax · Parameters · More Examples · Browser Support · Report Error ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found