MCPcopy Create free account
hub / github.com/Autoparallel/learner / setup_logging

Function setup_logging

crates/learnerd/src/main.rs:155–173  ·  view source on GitHub ↗

Configures the logging system based on the verbosity level # Arguments `verbosity` - Number of times the verbose flag was used (0-3) The verbosity levels are: - 0: warn (default) - 1: info - 2: debug - 3+: trace

(verbosity: u8)

Source from the content-addressed store, hash-verified

153/// - 2: debug
154/// - 3+: trace
155fn setup_logging(verbosity: u8) {
156 let filter = match verbosity {
157 0 => "error",
158 1 => "warn",
159 2 => "info",
160 3 => "debug",
161 _ => "trace",
162 };
163
164 let filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new(filter));
165
166 tracing_subscriber::fmt()
167 .with_env_filter(filter)
168 .with_file(true)
169 .with_line_number(true)
170 .with_thread_ids(true)
171 .with_target(true)
172 .init();
173}
174
175/// Entry point for the learnerd CLI application
176///

Callers 1

mainFunction · 0.85

Calls 1

initMethod · 0.80

Tested by

no test coverage detected