diff --git a/crates/typedialog-core/Cargo.toml b/crates/typedialog-core/Cargo.toml index 0579eff..2279e74 100644 --- a/crates/typedialog-core/Cargo.toml +++ b/crates/typedialog-core/Cargo.toml @@ -24,6 +24,7 @@ async-trait.workspace = true tera = { workspace = true, optional = true } tempfile.workspace = true dirs.workspace = true # For config path resolution +tracing.workspace = true # Logging framework # i18n (optional) fluent = { workspace = true, optional = true } @@ -50,7 +51,6 @@ axum = { workspace = true, optional = true } tokio = { workspace = true, optional = true } tower = { workspace = true, optional = true } tower-http = { workspace = true, optional = true } -tracing = { workspace = true, optional = true } tracing-subscriber = { workspace = true, optional = true } futures = { workspace = true, optional = true } @@ -76,7 +76,7 @@ criterion.workspace = true default = ["cli", "i18n", "templates"] cli = ["inquire", "dialoguer", "rpassword"] tui = ["ratatui", "crossterm", "atty"] -web = ["axum", "tokio", "tower", "tower-http", "tracing", "tracing-subscriber", "futures"] +web = ["axum", "tokio", "tower", "tower-http", "tracing-subscriber", "futures"] i18n = ["fluent", "fluent-bundle", "unic-langid", "sys-locale"] templates = ["tera"] nushell = ["nu-protocol", "nu-plugin"] diff --git a/crates/typedialog-core/benches/parsing_benchmarks.rs b/crates/typedialog-core/benches/parsing_benchmarks.rs index c5dcb1c..8431eee 100644 --- a/crates/typedialog-core/benches/parsing_benchmarks.rs +++ b/crates/typedialog-core/benches/parsing_benchmarks.rs @@ -1,4 +1,5 @@ -use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use criterion::{criterion_group, criterion_main, Criterion}; +use std::hint::black_box; use typedialog_core::form_parser::parse_toml; use typedialog_core::nickel::MetadataParser; diff --git a/crates/typedialog-core/src/nickel/contract_parser.rs b/crates/typedialog-core/src/nickel/contract_parser.rs index 2e58685..f3b06d5 100644 --- a/crates/typedialog-core/src/nickel/contract_parser.rs +++ b/crates/typedialog-core/src/nickel/contract_parser.rs @@ -100,13 +100,18 @@ impl ContractParser { ) { // Could be string, array, object, number, true, false, null // Skip parsing as validator call - eprintln!( - "[DEBUG] Skipping literal for field '{}': '{}'", - field_name, right_side + tracing::debug!( + field = %field_name, + value = %right_side, + "Skipping literal field (not a validator call)" ); continue; } - eprintln!("[DEBUG] Parsing field '{}': '{}'", field_name, right_side); + tracing::debug!( + field = %field_name, + expression = %right_side, + "Parsing field with validator" + ); // Extract module.function pairs from right side if let Some(dot_pos) = right_side.find('.') { diff --git a/crates/typedialog-tui/Cargo.toml b/crates/typedialog-tui/Cargo.toml index d15e177..c0c9e1f 100644 --- a/crates/typedialog-tui/Cargo.toml +++ b/crates/typedialog-tui/Cargo.toml @@ -24,6 +24,7 @@ tokio = { workspace = true, features = ["rt-multi-thread"] } serde_json = { workspace = true } toml = { workspace = true } unic-langid = { workspace = true } +tracing-subscriber = { workspace = true } [lints] workspace = true diff --git a/crates/typedialog-tui/src/main.rs b/crates/typedialog-tui/src/main.rs index 4bd0871..43129ea 100644 --- a/crates/typedialog-tui/src/main.rs +++ b/crates/typedialog-tui/src/main.rs @@ -149,6 +149,14 @@ enum Commands { #[tokio::main] async fn main() -> Result<()> { + // Initialize tracing subscriber with env filter (respects RUST_LOG) + tracing_subscriber::fmt() + .with_env_filter( + tracing_subscriber::EnvFilter::try_from_default_env() + .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")), + ) + .init(); + let args = Args::parse(); // Load configuration with CLI override diff --git a/crates/typedialog-web/Cargo.toml b/crates/typedialog-web/Cargo.toml index 86ed558..1cccc88 100644 --- a/crates/typedialog-web/Cargo.toml +++ b/crates/typedialog-web/Cargo.toml @@ -24,6 +24,7 @@ tokio = { workspace = true, features = ["rt-multi-thread"] } serde_json = { workspace = true } toml = { workspace = true } unic-langid = { workspace = true } +tracing-subscriber = { workspace = true } [lints] workspace = true diff --git a/crates/typedialog-web/src/main.rs b/crates/typedialog-web/src/main.rs index 841904a..a5499d9 100644 --- a/crates/typedialog-web/src/main.rs +++ b/crates/typedialog-web/src/main.rs @@ -211,6 +211,14 @@ fn extract_nickel_defaults( #[tokio::main] async fn main() -> Result<()> { + // Initialize tracing subscriber with env filter (respects RUST_LOG) + tracing_subscriber::fmt() + .with_env_filter( + tracing_subscriber::EnvFilter::try_from_default_env() + .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")), + ) + .init(); + let args = Args::parse(); // Load configuration with CLI override diff --git a/crates/typedialog/Cargo.toml b/crates/typedialog/Cargo.toml index 0ffa93f..606142c 100644 --- a/crates/typedialog/Cargo.toml +++ b/crates/typedialog/Cargo.toml @@ -24,6 +24,7 @@ tokio = { workspace = true, features = ["rt-multi-thread"] } serde_json = { workspace = true } toml = { workspace = true } unic-langid = { workspace = true } +tracing-subscriber = { workspace = true } [lints] workspace = true diff --git a/crates/typedialog/src/main.rs b/crates/typedialog/src/main.rs index 66f03cf..5755e05 100644 --- a/crates/typedialog/src/main.rs +++ b/crates/typedialog/src/main.rs @@ -300,6 +300,14 @@ enum Commands { #[tokio::main] async fn main() -> Result<()> { + // Initialize tracing subscriber with env filter (respects RUST_LOG) + tracing_subscriber::fmt() + .with_env_filter( + tracing_subscriber::EnvFilter::try_from_default_env() + .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")), + ) + .init(); + let cli = Cli::parse(); // Load configuration with CLI override