add tracing_subscriber and test_log::test

I don't know when and why we dropped log::* in favor of tracing but when it was done, it made relevant logs not appear any more while debugging so... I added test_log::test which helps by automatically adding info logs from trace package.
This commit is contained in:
Pere Diaz Bou 2025-03-05 12:43:26 +01:00
parent a7f3579a0a
commit 9a01e32c01
7 changed files with 167 additions and 18 deletions

View file

@ -7,6 +7,7 @@ mod opcodes_dictionary;
use rustyline::{error::ReadlineError, Config, Editor};
use std::sync::atomic::Ordering;
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
fn rustyline_config() -> Config {
Config::builder()
@ -15,8 +16,11 @@ fn rustyline_config() -> Config {
}
fn main() -> anyhow::Result<()> {
env_logger::init();
let mut rl = Editor::with_config(rustyline_config())?;
tracing_subscriber::registry()
.with(fmt::layer())
.with(EnvFilter::from_default_env())
.init();
let mut app = app::Limbo::new(&mut rl)?;
let home = dirs::home_dir().expect("Could not determine home directory");
let history_file = home.join(".limbo_history");