-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Needed to change because going to using current working directory to decide where to put logs thus need that to be set before starting logging. - So removed log messages during folder setting as they cannot be seen and would just be misleading. - Added new log message after setting current working directory. Also marks the start of the program.
- Loading branch information
Showing
3 changed files
with
11 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,8 @@ | ||
use clap::Parser; | ||
use conn_mon::{run, Cli}; | ||
use env_logger::Builder; | ||
use log::LevelFilter; | ||
|
||
fn main() -> anyhow::Result<()> { | ||
let cli = Cli::parse(); | ||
init_logging(cli.log_level.into())?; | ||
run(cli)?; | ||
Ok(()) | ||
} | ||
|
||
fn init_logging(level: LevelFilter) -> anyhow::Result<()> { | ||
// TODO: Change to log to file | ||
Builder::new().filter(None, level).try_init()?; | ||
Ok(()) | ||
} |