From 020e1383e49823dc1da00d71317f941621dc3488 Mon Sep 17 00:00:00 2001 From: Daniel Karzel Date: Tue, 30 Nov 2021 16:42:20 +1100 Subject: [PATCH] Log target = module ``` 2021-11-30 16:39:33 INFO daemon::logger: Initialized logger 2021-11-30 16:39:33 INFO taker: Running version: 0.1.2-11-g09cfe03 ``` instead of ``` 2021-11-30 14:33:14 INFO Initialized logger 2021-11-30 14:33:14 INFO Running version: 0.1.1-367-gcbc42b6 ``` Makes it way easier to interpret logs because we have context who logged what. --- daemon/src/logger.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/daemon/src/logger.rs b/daemon/src/logger.rs index 50551c1..c450794 100644 --- a/daemon/src/logger.rs +++ b/daemon/src/logger.rs @@ -20,8 +20,7 @@ pub fn init(level: LevelFilter, json_format: bool) -> Result<()> { .with_env_filter(filter) .with_writer(std::io::stderr) .with_ansi(is_terminal) - .with_timer(ChronoLocal::with_format("%F %T".to_owned())) - .with_target(false); + .with_timer(ChronoLocal::with_format("%F %T".to_owned())); if json_format { builder.json().init();