MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / main

Function main

1a_logging/rust/logex/src/main.rs:23–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23fn main() {
24 Builder::new()
25 .format(|buf, record| {
26 writeln!(
27 buf,
28 "{} [{}] [{}] - {}",
29 Local::now().format("%Y-%m-%dT%H:%M:%S"),
30 record.level(),
31 record.module_path().unwrap_or("-"),
32 record.args()
33 )
34 })
35 // run with LOGEX_LOG="warn,logex::foo=info,logex::foo::bar=debug"
36 .parse_env("LOGEX_LOG")
37 // filter_level wins over environment
38 .filter_level(LevelFilter::Info)
39 .init();
40
41 log::warn!("warn");
42 log::error!("error");
43 log::info!("info");
44 log::debug!("debug");
45 foo::run();
46}

Callers

nothing calls this directly

Calls 1

runFunction · 0.70

Tested by

no test coverage detected