Skip to content

Commit

Permalink
include debug level in release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
radumarias committed Jul 31, 2024
1 parent 9481d63 commit f816b10
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,6 @@ pub static GID: LazyLock<u32> = LazyLock::new(|| unsafe { libc::getgid() });
#[must_use]
pub const fn is_debug() -> bool {
#[cfg(debug_assertions)]
{
return true;
}
true;
false
}
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit f816b10

Please sign in to comment.