trufflesuite / ganache-cli-archive

Fast Ethereum RPC client for testing and development. See https://github.com/trufflesuite/ganache for current development.
https://www.trufflesuite.com/ganache
MIT License
3.36k stars 695 forks source link

can solidity have console.log()? #843

Closed myuniswap2000 closed 2 years ago

myuniswap2000 commented 2 years ago

Hello, everyone. In Ganache cli, is there anything like hardhat's console. log()?

davidmurdoch commented 2 years ago

This is actually an experimental truffle feature. See https://github.com/trufflesuite/truffle-logger-example/issues/3 for info.

I don't think ganache itself could handle solidity features like this, as it doesn't even know about solidity; it deals with EVM OpCodes. If the solidity compiler itself allowed for a special opcode for logging ganache could handle it, but as things are now, there's no easy way to do this.

Perhaps ganache-cli itself could try to intercept/use hardhat's and truffle's console.sol events to log these itself. Is that the behavior you were hoping for?

myuniswap2000 commented 2 years ago

thank you very much ! I know.