diff --git a/Cargo.toml b/Cargo.toml index 5d9a35d5..f5677a37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ tokio = { version = "1.36", features = ["full"] } tokio-stream = { version = "0.1.15", features = ["fs"] } futures-util = "0.3.30" bytes = "1.5" -tracing = { version = "0.1.40", features = ["max_level_trace", "release_max_level_info"] } +tracing = { version = "0.1.40", features = ["max_level_trace", "release_max_level_debug"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] } tracing-appender = "0.2.3" tracing-test = "0.2.4" diff --git a/src/lib.rs b/src/lib.rs index 9397ed72..0abffcf3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -316,8 +316,6 @@ pub static GID: LazyLock = LazyLock::new(|| unsafe { libc::getgid() }); #[must_use] pub const fn is_debug() -> bool { #[cfg(debug_assertions)] - { - return true; - } + true; false } diff --git a/src/main.rs b/src/main.rs index 30a83edc..1746faf8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -474,6 +474,9 @@ fn umount(mountpoint: &str) -> io::Result<()> { #[allow(clippy::missing_panics_doc)] pub fn log_init(level: Level) -> WorkerGuard { + // Set the RUST_LOG environment variable to include debug logs + env::set_var("RUST_LOG", "debug"); + let directive = format!("rencfs={}", level.as_str()) .parse() .expect("cannot parse log directive");