Workspace Filter
Simple framework to compile env filters for all packages in a workspace.
Setup
First, add the two dependencies to your crate:
[]
= "0.1"
[]
= "0.1"
Then, call the build function in your build.rs file:
build?;
}
The macro can then be used in your crate, with a few example use-cases shown below:
Simple Usage
If you only care to set the filter for your workspace dependencies:
let filter = workspace_filter!;
let env_filter = builder.parse_lossy;
Manual filters can be included, for example to make workspace crates at debug and everything else at info:
let filter = workspace_filter!;
let env_filter = builder.parse_lossy;
In the catchall argument, {level} can be also used anywhere to substitute the given workspace level.
let filter = workspace_filter!;
let env_filter = builder.parse_lossy;
Verbosity level Example
Example that overrides with RUST_LOG, or falls back to increasing the
verbosity for the workspace and other deps depending on a given number
let filter = var.unwrap_or_else;
let env_filter = builder.parse_lossy;