Open iamdefinitelyahuman opened 4 years ago
Forgot to mention that https://tenderly.dev/ implements the same console.log
functionality.
Has this feature been implemented now? @iamdefinitelyahuman
Not yet, need #1043 first
how about now? because it looks like #1043 has been merged. @iamdefinitelyahuman
The issue is still open so I comment how I got it to work: I just installed hardhat and dependencies normally with npm, then I run my network with npx hardhat node --network hardhat
.
The solidity import uses absolute path import "../node_modules/hardhat/console.sol";
. It works and I get the console logs in the hardhat console when I do testing with brownie.
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/
Emitting events don't work if the tx reverts. Also don't spam your blog posts here.
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/
Actually I am pretty sure that there's still logs up to the revert.
My bad: with eth-brownie indeed tx.events
will return the events of a failed tx too
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/
I actually appreciate the blogpost spam, thanks. Good workaround @zmeghji <3
Submitted a PR with the implemented feature.
Overview
Brownie should support
console.log
as implemented by BuidlerSpecification
import "@nomiclabs/buidler/console.sol";
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 thedebug_traceTransaction
output.Considerations
console.sol
without reliance on NPM? The solution will likely require expanding the brownie package manager.