Fix cfg condition for debug logging (996a5488be)
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -32,9 +32,9 @@ cargo_feat_sets = {
|
|||||||
# Default features
|
# Default features
|
||||||
default = "brotli_compression,element_hacks,gzip_compression,io_uring,jemalloc,jemalloc_conf,media_thumbnail,release_max_log_level,systemd,url_preview,zstd_compression"
|
default = "brotli_compression,element_hacks,gzip_compression,io_uring,jemalloc,jemalloc_conf,media_thumbnail,release_max_log_level,systemd,url_preview,zstd_compression"
|
||||||
# All features sans release_max_log_level
|
# All features sans release_max_log_level
|
||||||
logging = "blurhashing,brotli_compression,bzip2_compression,console,default,direct_tls,element_hacks,gzip_compression,hardened_malloc,io_uring,jemalloc,jemalloc_conf,jemalloc_prof,jemalloc_stats,ldap,lz4_compression,media_thumbnail,perf_measurements,sentry_telemetry,systemd,tokio_console,tuwunel_mods,url_preview,zstd_compression"
|
logging = "blurhashing,brotli_compression,bzip2_compression,console,direct_tls,element_hacks,gzip_compression,hardened_malloc,io_uring,jemalloc,jemalloc_conf,jemalloc_prof,jemalloc_stats,ldap,lz4_compression,media_thumbnail,perf_measurements,sentry_telemetry,systemd,tokio_console,tuwunel_mods,url_preview,zstd_compression"
|
||||||
# All features
|
# All features
|
||||||
all = "blurhashing,brotli_compression,bzip2_compression,console,default,direct_tls,element_hacks,gzip_compression,hardened_malloc,io_uring,jemalloc,jemalloc_conf,jemalloc_prof,jemalloc_stats,ldap,lz4_compression,media_thumbnail,perf_measurements,release_max_log_level,sentry_telemetry,systemd,tokio_console,tuwunel_mods,url_preview,zstd_compression"
|
all = "blurhashing,brotli_compression,bzip2_compression,console,direct_tls,element_hacks,gzip_compression,hardened_malloc,io_uring,jemalloc,jemalloc_conf,jemalloc_prof,jemalloc_stats,ldap,lz4_compression,media_thumbnail,perf_measurements,release_max_log_level,sentry_telemetry,systemd,tokio_console,tuwunel_mods,url_preview,zstd_compression"
|
||||||
}
|
}
|
||||||
variable "cargo_features_always" {
|
variable "cargo_features_always" {
|
||||||
default = "direct_tls"
|
default = "direct_tls"
|
||||||
|
|||||||
@@ -53,11 +53,7 @@ macro_rules! debug_info {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const INFO_SPAN_LEVEL: Level = if cfg!(debug_assertions) {
|
pub const INFO_SPAN_LEVEL: Level = if logging() { Level::INFO } else { Level::DEBUG };
|
||||||
Level::INFO
|
|
||||||
} else {
|
|
||||||
Level::DEBUG
|
|
||||||
};
|
|
||||||
|
|
||||||
pub static DEBUGGER: LazyLock<bool> =
|
pub static DEBUGGER: LazyLock<bool> =
|
||||||
LazyLock::new(|| env::var("_").unwrap_or_default().ends_with("gdb"));
|
LazyLock::new(|| env::var("_").unwrap_or_default().ends_with("gdb"));
|
||||||
@@ -121,5 +117,7 @@ pub fn type_name<T: ?Sized>() -> &'static str { std::any::type_name::<T>() }
|
|||||||
#[must_use]
|
#[must_use]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn logging() -> bool {
|
pub const fn logging() -> bool {
|
||||||
cfg!(debug_assertions) || cfg!(tuwunel_debug) || cfg!(not(feature = "release_max_log_level"))
|
cfg!(debug_assertions)
|
||||||
|
|| cfg!(tuwunel_debug_logging)
|
||||||
|
|| !cfg!(feature = "release_max_log_level")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user