Skip to content

Commit

Permalink
Merge pull request #84 from jabibamman/restyled/chore/logger-cli-enha…
Browse files Browse the repository at this point in the history
…nced

Restyle Chore: Update logging levels based on flags
  • Loading branch information
jabibamman authored Feb 24, 2024
2 parents d51fcbf + 7c5deac commit b10e906
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion cli/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ pub struct CliServerArgs {
#[clap(short = 't', long = "trace", action = clap::ArgAction::Count)]
pub trace: u8,


/// Optional: Add a flag to edit the width and height of the window.
/// Default: 1200
#[clap(long = "width", default_value = "1200")]
Expand Down
6 changes: 3 additions & 3 deletions shared/src/logger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ pub fn init_logger(verbose: u8, debug: u8, trace: u8) -> Result<(), FractalError
(0, 0, 0) => LevelFilter::Error, // default
(_, 1, 0) => LevelFilter::Debug, // -d
(1, _, _) => LevelFilter::Info, // -v
(_, _, 1) => LevelFilter::Trace, // -t
_ => LevelFilter::Warn, // multiple flags
(_, _, 1) => LevelFilter::Trace, // -t
_ => LevelFilter::Warn, // multiple flags
};

let mut builder = Builder::from_env(Env::default());

builder.format_timestamp(Some(env_logger::TimestampPrecision::Millis));
Expand Down

0 comments on commit b10e906

Please sign in to comment.