Skip to content

Commit

Permalink
repl: log to a file
Browse files Browse the repository at this point in the history
ai: true
  • Loading branch information
simonrw committed Feb 3, 2025
1 parent f722ab3 commit 6f7fe02
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion repl/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::sync::Mutex;
use std::thread::JoinHandle;
use std::{io::Write, path::PathBuf};

Expand All @@ -7,6 +8,7 @@ use crossbeam_channel::Receiver;
use debugger::Breakpoint;
use debugger::Debugger;
use debugger::ProgramDescription;
use tracing_subscriber::filter::EnvFilter;

struct App {
debugger: Debugger,
Expand Down Expand Up @@ -147,7 +149,11 @@ struct Args {

fn main() -> eyre::Result<()> {
color_eyre::install().context("installing color_eyre")?;
tracing_subscriber::fmt::init();
let log_file = std::fs::File::create("log.log")?;
tracing_subscriber::fmt()
.with_env_filter(EnvFilter::from_default_env())
.with_writer(Mutex::new(log_file))
.init();

let args = Args::parse();
let debugger = Debugger::from_launch_configuration(args.launch_configuration, args.name)
Expand Down

0 comments on commit 6f7fe02

Please sign in to comment.