Skip to content

Commit d1a1ee5

Browse files
committed
style(aggregator): set application name in log to mithril-aggregator
Instead of the default `slog-rs`.
1 parent 1c06fed commit d1a1ee5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

mithril-aggregator/src/main.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
#![doc = include_str!("../README.md")]
22

33
use clap::Parser;
4-
use mithril_aggregator::{CommandType, MainOpts};
5-
use mithril_common::StdResult;
64
use slog::{Drain, Fuse, Level, Logger};
75
use slog_async::Async;
86
use std::sync::Arc;
97

8+
use mithril_aggregator::{CommandType, MainOpts};
9+
use mithril_common::StdResult;
10+
1011
fn build_io_logger<W: std::io::Write + Send + 'static>(log_level: Level, io: W) -> Fuse<Async> {
11-
let drain = slog_bunyan::new(io).set_pretty(false).build().fuse();
12+
let drain = slog_bunyan::with_name("mithril-aggregator", io)
13+
.set_pretty(false)
14+
.build()
15+
.fuse();
1216
let drain = slog::LevelFilter::new(drain, log_level).fuse();
1317

14-
slog_async::Async::new(drain).build().fuse()
18+
Async::new(drain).build().fuse()
1519
}
1620

1721
/// Build a logger from args.

0 commit comments

Comments
 (0)