Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: conservatively use log::info instead of println for some expressions #3766

Merged
merged 9 commits into from
Dec 11, 2023
Prev Previous commit
Next Next commit
use NOIR_LOG as environment variable
kevaundray committed Dec 11, 2023
commit 5b56efdc421931cb2e7b47499c79e10f6f5030c4
5 changes: 4 additions & 1 deletion tooling/nargo_cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -12,11 +12,14 @@ mod cli;
mod errors;

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

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() {
env_logger::init();
let env = Env::default().filter_or("NOIR_LOG", "error"); // Default to 'error' if NOIR is not set
kevaundray marked this conversation as resolved.
Show resolved Hide resolved
Builder::from_env(env).init();

// Register a panic hook to display more readable panic messages to end-users
let (panic_hook, _) =
HookBuilder::default().display_env_section(false).panic_section(PANIC_MESSAGE).into_hooks();

Unchanged files with check annotations Beta

#[test]
fn raises_error_on_missing_binary() {
let bad_backend = Backend::new("i_dont_exist".to_string());

Check warning on line 192 in tooling/backend_interface/src/lib.rs

GitHub Actions / Spellcheck / Spellcheck

Unknown word (dont)
let binary_path = bad_backend.assert_binary_exists();