Skip to content

Commit

Permalink
init logger only once
Browse files Browse the repository at this point in the history
  • Loading branch information
darmie committed Jan 29, 2024
1 parent 9aecaff commit 7a30078
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions zflow_runtime/src/extern_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ impl ExternProvider {
}

mod test {
use std::{collections::HashMap, env::current_dir};
use std::{collections::HashMap, env::current_dir, sync::Once};

use serde_json::json;
use simple_logger::SimpleLogger;
Expand All @@ -391,14 +391,18 @@ mod test {
};
use log::{log, Level};

static INIT: Once = Once::new();

fn init() {
SimpleLogger::default()
INIT.call_once(||{
SimpleLogger::default()
.with_colors(true)
.without_timestamps()
.with_level(log::LevelFilter::Off)
.with_module_level("zflow_runtime::extern_provider", log::LevelFilter::Debug)
.init()
.unwrap();
});
}

fn get_graph() -> Graph {
Expand Down

0 comments on commit 7a30078

Please sign in to comment.