mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-23 23:27:57 +01:00
14 lines
426 B
Rust
14 lines
426 B
Rust
use slog::{Drain, Logger};
|
|
use slog_async;
|
|
use slog_async::AsyncGuard;
|
|
use slog_term::{TermDecorator, FullFormat};
|
|
|
|
pub fn init() -> (Logger, AsyncGuard) {
|
|
let decorator = TermDecorator::new().build();
|
|
let drain = FullFormat::new(decorator).build().fuse();
|
|
let (drain, guard) = slog_async::Async::new(drain).build_with_guard();
|
|
let drain = drain.fuse();
|
|
|
|
return (slog::Logger::root(drain, o!()), guard);
|
|
}
|