mirror of
https://github.com/nitnelave/lldap.git
synced 2023-04-12 14:25:13 +00:00
18 lines
580 B
Rust
18 lines
580 B
Rust
|
use crate::infra::configuration::Configuration;
|
||
|
use anyhow::Context;
|
||
|
use tracing::subscriber::set_global_default;
|
||
|
use tracing_log::LogTracer;
|
||
|
|
||
|
pub fn init(_config: Configuration) -> anyhow::Result<()> {
|
||
|
// TODO: use config.log_level_verbose to set level
|
||
|
|
||
|
let subscriber = tracing_subscriber::fmt()
|
||
|
.with_timer(tracing_subscriber::fmt::time::time())
|
||
|
.with_target(false)
|
||
|
.with_level(true)
|
||
|
.finish();
|
||
|
LogTracer::init().context("Failed to set logger")?;
|
||
|
set_global_default(subscriber).context("Failed to set subscriber")?;
|
||
|
Ok(())
|
||
|
}
|