foundry/docs/dev/debugging.md
2023-12-01 12:43:33 +01:00

931 B

Debugging Foundry tools

This is a working document intended to outline some commands contributors can use to debug various parts of Foundry.

Logs

All crates use tracing for logging. A console formatter is installed in each binary (cast, forge, anvil).

By setting RUST_LOG=<filter> you can get a lot more info out of Forge and Cast. For example, running Forge with RUST_LOG=forge will emit all logs of the cli crate, same for Cast.

The most basic valid filter is a log level, of which these are valid:

  • error
  • warn
  • info
  • debug
  • trace

Filters are explained in detail in the env_logger crate docs.

Compiler input and output

You can get the compiler input JSON and output JSON from ethers-solc by passing the --build-info flag. This will create two files: one for the input and one for the output.