Skip to content

Commit

Permalink
refactor: add log flag
Browse files Browse the repository at this point in the history
  • Loading branch information
zmalatrax committed Nov 6, 2024
1 parent 53fb010 commit 7e21b4d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/brainfuck_vm/src/bin/brainfuck_vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
io::{stdin, stdout},
path::PathBuf,
};
use tracing_subscriber::{fmt, EnvFilter};
use tracing_subscriber;

use brainfuck_vm::{compiler::Compiler, machine::Machine};

Expand All @@ -15,6 +15,8 @@ use brainfuck_vm::{compiler::Compiler, machine::Machine};
struct Args {
#[clap(value_parser, value_hint=ValueHint::FilePath)]
filename: PathBuf,
#[clap(long, default_value = "info")]
log: String,
#[clap(long)]
trace: bool,
#[clap(long)]
Expand All @@ -26,8 +28,7 @@ struct Args {
fn main() {
let args = Args::parse();

// Constructs a subscriber whose severity level is filtered by `RUST_LOG`
fmt().with_env_filter(EnvFilter::from_default_env()).init();
tracing_subscriber::fmt().with_env_filter(args.log).init();

let code = fs::read_to_string(&args.filename)
.expect("Failed to read file")
Expand Down

0 comments on commit 7e21b4d

Please sign in to comment.