mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
log to the terminal as well
This commit is contained in:
parent
dc62d5072c
commit
03db16460a
1 changed files with 9 additions and 1 deletions
|
@ -28,7 +28,15 @@ fn file(path: &str) -> io::Result<Logger> {
|
||||||
let decorator = slog_term::PlainSyncDecorator::new(file);
|
let decorator = slog_term::PlainSyncDecorator::new(file);
|
||||||
let drain = slog_term::FullFormat::new(decorator).build().fuse();
|
let drain = slog_term::FullFormat::new(decorator).build().fuse();
|
||||||
let drain = slog_envlogger::new(drain);
|
let drain = slog_envlogger::new(drain);
|
||||||
let drain = slog_async::Async::new(drain)
|
|
||||||
|
// log to the terminal as well
|
||||||
|
let decorator = slog_term::TermDecorator::new().build();
|
||||||
|
let term_drain = slog_term::FullFormat::new(decorator).build().fuse();
|
||||||
|
let term_drain = slog_envlogger::new(term_drain);
|
||||||
|
|
||||||
|
let joined_drain = slog::Duplicate::new(drain, term_drain).fuse();
|
||||||
|
|
||||||
|
let drain = slog_async::Async::new(joined_drain)
|
||||||
.chan_size(1_024)
|
.chan_size(1_024)
|
||||||
.overflow_strategy(OverflowStrategy::Block)
|
.overflow_strategy(OverflowStrategy::Block)
|
||||||
.build()
|
.build()
|
||||||
|
|
Loading…
Reference in a new issue