Browse Source

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.
no-buy-button-while-setting-up-cfd
Daniel Karzel 3 years ago
parent
commit
020e1383e4
No known key found for this signature in database GPG Key ID: 30C3FC2E438ADB6E
  1. 3
      daemon/src/logger.rs

3
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();

Loading…
Cancel
Save