add uptime to init
cargo devel CI / cargo CI (push) Has been cancelled Details

This commit is contained in:
Christoph J. Scherr 2024-01-23 14:02:46 +01:00
parent 5443acef3e
commit c968e44349
Signed by: cscherrNT
GPG Key ID: 8E2B45BC51A27EA7
3 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@ impl Logger {
/// Will enable the logger to be used.
///
/// Assumes some defaults, use [`init_customized`](Self::init_customized) for more control
pub fn init(log_dir: Option<PathBuf>, max_level: Option<Level>) -> Result<()> {
pub fn init(log_dir: Option<PathBuf>, max_level: Option<Level>, uptime: bool) -> Result<()> {
Self::init_customized(
log_dir.is_some(),
log_dir.unwrap_or(PathBuf::from(DEFAULT_LOG_DIR)),
@ -89,7 +89,7 @@ impl Logger {
false,
false,
true,
false,
uptime,
)
}

View File

@ -91,7 +91,7 @@ fn main() {
}
};
if cli.log_meta {
Logger::init(None, Some(ll)).expect("could not initialize Logger");
Logger::init(None, Some(ll), false).expect("could not initialize Logger");
} else {
// less verbose version
Logger::init_mini(Some(ll)).expect("could not initialize Logger");

View File

@ -165,7 +165,7 @@ fn cli_parse() -> Cli {
}
};
if cli.meta {
Logger::init(None, Some(ll)).expect("could not initialize Logger");
Logger::init(None, Some(ll), false).expect("could not initialize Logger");
} else {
// less verbose version
Logger::init_mini(Some(ll)).expect("could not initialize Logger");