What are the different verbosity levels in Forge testing?

Beginner

Answer

Forge provides multiple verbosity levels controlled by the number of v flags:

  • Default: Shows test results only
  • -v: Shows logs for failing tests
  • -vv: Shows logs for all tests and gas usage
  • -vvv: Shows execution traces for failing tests
  • -vvvv: Shows execution traces for all tests and setup
  • -vvvvv: Shows execution and setup traces, plus internal steps
    Higher verbosity levels are crucial for debugging failed tests and understanding gas consumption patterns.