crytic / medusa

Parallelized, coverage-guided, mutational Solidity smart contract fuzzing, powered by go-ethereum
https://www.trailofbits.com/
GNU Affero General Public License v3.0
292 stars 37 forks source link

Remove use of global logger in `cmd` package #340

Open anishnaik opened 6 months ago

anishnaik commented 6 months ago

Currently, we use the global logger to log errors and other information during calls to medusa init and medusa fuzz. However, the problem with this is that we are unable to validate the LoggingConfig config options until NewFuzzer is called. For example, you can set NoColor to true but the global logger will still output color. Personally, the best thing to do is not use a logger in the cmd package and stick with fmt.Printf statements. I think this is generally a well-founded practice.

The other option is to validate the logging config before NewFuzzer however this causes some complications:

  1. You won't be able to do it for the init command since a config is not provided.
  2. It breaks the expected API-usage of the system