Skip to content

Commit

Permalink
fix: fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Sep 11, 2024
1 parent 1c2e40f commit dcc221c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
9 changes: 0 additions & 9 deletions log4rs_sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,3 @@ root:
appenders:
- stdout
- xtrgpuminer

loggers:
# Route log events common to every application to all appenders
tari::gpuminer:
level: info
appenders:
- stdout
- default
additive: false
16 changes: 8 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ struct Cli {
async fn main_inner() -> Result<(), anyhow::Error> {
let cli = Cli::parse();

if cli.log_config_file.is_some() && cli.log_dir.is_some() {
if let Err(e) = initialize_logging(
&cli.log_config_file.as_ref().cloned().unwrap_or_default(),
&cli.log_dir.as_ref().cloned().unwrap_or_default(),
if let Some(ref log_dir) = cli.log_dir {

tari_common::initialize_logging(
&log_dir
.join("log4rs_config.yml"),
&log_dir.join("xtrgpuminer"),
include_str!("../log4rs_sample.yml"),
) {
eprintln!("Gpu main_inner error: {}", e);
return Err(e.into());
}
)
.expect("Could not set up logging");
}

let benchmark = cli.benchmark;
Expand Down

0 comments on commit dcc221c

Please sign in to comment.