pub fn setup_logger()
Available on crate feature logs only.
Expand description

Setup logger according to RUST_LOG env var (must enable “logs” feature)

During tests log to stdout to supress output on passes

Enable the feature:

Cargo.toml

[dependencies]
voluntary_servitude = { version = "3", features = "logs" }

Set the RUST_LOG env var:

export RUST_LOG=voluntary_servitude=trace
export RUST_LOG=voluntary_servitude=debug
export RUST_LOG=voluntary_servitude=info
export RUST_LOG=voluntary_servitude=warn
export RUST_LOG=voluntary_servitude=error
// Must enable the "logs" feature and set the appropriate `RUST_LOG` env var
voluntary_servitude::setup_logger();
// Call code to be logged
// ...