aboutsummaryrefslogtreecommitdiff
path: root/crates/whirl_common/src/log.rs
blob: 39ceca0156fcacbba5f9b1d6ced2e94dea771600 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective
// SPDX-License-Identifier: GPL-3.0-only

use whirl_config::Config;

pub fn calculate_log_level() -> String {
  let mut level;

  level = match Config::get().whirlsplash.log.level {
    2 => "debug".to_string(),
    3 => "trace".to_string(),
    _ => "info".to_string(),
  };
  if !Config::get().whirlsplash.log.everything {
    level = format!("whirl={}", level);
  }

  level
}