From 7d57f06faf0bd313b98c25c6a980d24c142cec2a Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 3 Oct 2024 21:13:16 +0200 Subject: [PATCH] test --- Cargo.lock | 1 + rust/extractor/Cargo.toml | 1 + rust/extractor/src/main.rs | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7461d82b43779..72537e6c0c614 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -393,6 +393,7 @@ dependencies = [ "serde", "serde_with", "stderrlog", + "tracing-subscriber", "triomphe", ] diff --git a/rust/extractor/Cargo.toml b/rust/extractor/Cargo.toml index 2a7112912582c..cf5a707ac904e 100644 --- a/rust/extractor/Cargo.toml +++ b/rust/extractor/Cargo.toml @@ -29,3 +29,4 @@ argfile = "0.2.1" codeql-extractor = { path = "../../shared/tree-sitter-extractor" } rust-extractor-macros = { path = "macros" } itertools = "0.13.0" +tracing-subscriber = { features=["env-filter"], version="0.3.18" } diff --git a/rust/extractor/src/main.rs b/rust/extractor/src/main.rs index 701b2f0b38ea8..214cdc561ca03 100644 --- a/rust/extractor/src/main.rs +++ b/rust/extractor/src/main.rs @@ -38,11 +38,19 @@ fn extract( Ok(()) } fn main() -> anyhow::Result<()> { + use tracing_subscriber::{fmt, prelude::*, EnvFilter}; + let filter: EnvFilter = "ra_ap_project_model=debug" + .parse() + .expect("filter should parse"); + tracing_subscriber::registry() + .with(fmt::layer()) + .with(filter) + .init(); let cfg = config::Config::extract().context("failed to load configuration")?; - stderrlog::new() - .module(module_path!()) - .verbosity(2 + cfg.verbose as usize) - .init()?; + // stderrlog::new() + // .module(module_path!()) + // .verbosity(2 + cfg.verbose as usize) + // .init()?; log::info!("{cfg:?}"); let rust_analyzer = rust_analyzer::RustAnalyzer::new(&cfg)?;