Skip to content

Commit

Permalink
chore: restore env_logger
Browse files Browse the repository at this point in the history
  • Loading branch information
kobyhallx committed Dec 13, 2023
1 parent 1cbe30b commit 48bf364
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
44 changes: 42 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tooling/nargo_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ hex.workspace = true
similar-asserts.workspace = true
termcolor = "1.1.2"
color-eyre = "0.6.2"
env_logger = "0.9.0"
tokio = { version = "1.0", features = ["io-std"] }

# Backends
Expand Down
4 changes: 4 additions & 0 deletions tooling/nargo_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ mod errors;
use std::env;

use color_eyre::config::HookBuilder;
use env_logger::{Builder, Env};
use tracing_appender::rolling;

const PANIC_MESSAGE: &str = "This is a bug. We may have already fixed this in newer versions of Nargo so try searching for similar issues at https://github.com/noir-lang/noir/issues/.\nIf there isn't an open issue for this bug, consider opening one at https://github.com/noir-lang/noir/issues/new?labels=bug&template=bug_report.yml";

fn main() {
let env = Env::default().filter_or("NOIR_LOG", "error"); // Default to 'error' if NOIR_LOG is not set
Builder::from_env(env).init();

// Setup tracing
if let Ok(log_dir) = env::var("NARGO_LOG_DIR") {
let debug_file = rolling::daily(log_dir, "nargo-log");
Expand Down

0 comments on commit 48bf364

Please sign in to comment.