foundry-rs / foundry-rs/forge-std

feat(console): expose verbosity level and support logging levels

Open
#684 0 comments 1 reaction 0 assignees View on GitHub
T-feature
Dominant language
Solidity
Stars
1.1k
Forks
520
Avg merge
3d 13h
Merged PRs (30d)
9

Description

### Component

Forge

### Describe the feature you would like

It would be handy if forge-std exposed the verbosity level, e.g. `function verbosityLevel() external returns (uint8);`

This is useful when a script has console logging, but wants to adjust the amount of logging according to the verbosity.

e.g.

```
if (vm.verbosityLevel() > 3) console2.log("some debug log here");
```

Even better:

```
console2.debug("some debug log here");
```

Where it only prints the log to the console if the verbosity level is >= 4

I checked `Vm.sol` and didn't find any mention of this, FYI.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.