change(build): Disable debug logging at compile time in release builds (#4516)
* Add zebrad features that disable debug logs at compile time * By default, disable debug logs at compile time in release builds
This commit is contained in:
parent
77d9d8f017
commit
9cc4584bc6
|
@ -13,11 +13,26 @@ repository = "https://github.com/ZcashFoundation/zebra"
|
||||||
default-run = "zebrad"
|
default-run = "zebrad"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
# In release builds, don't compile debug logging code, to improve performance.
|
||||||
|
default = ["release_max_level_info"]
|
||||||
|
|
||||||
# Production features that activate extra dependencies
|
# Production features that activate extra dependencies
|
||||||
enable-sentry = ["sentry", "sentry-tracing"]
|
enable-sentry = ["sentry", "sentry-tracing"]
|
||||||
|
|
||||||
|
# Production features that modify dependency behaviour
|
||||||
|
|
||||||
|
# Remove verbose logging at compile-time in release or all builds.
|
||||||
|
#
|
||||||
|
# Release builds are defined as "cfg(not(debug_assertions))".
|
||||||
|
# https://docs.rs/tracing/latest/tracing/level_filters/index.html#compile-time-filters
|
||||||
|
release_max_level_warn = ["tracing/release_max_level_warn", "log/release_max_level_warn"]
|
||||||
|
release_max_level_info = ["tracing/release_max_level_info", "log/release_max_level_info"]
|
||||||
|
release_max_level_debug = ["tracing/release_max_level_debug", "log/release_max_level_debug"]
|
||||||
|
|
||||||
|
max_level_warn = ["tracing/max_level_warn", "log/max_level_warn"]
|
||||||
|
max_level_info = ["tracing/max_level_info", "log/max_level_info"]
|
||||||
|
max_level_debug = ["tracing/max_level_debug", "log/max_level_debug"]
|
||||||
|
|
||||||
# Testing features that activate extra dependencies
|
# Testing features that activate extra dependencies
|
||||||
proptest-impl = ["proptest", "proptest-derive", "zebra-chain/proptest-impl", "zebra-state/proptest-impl", "zebra-consensus/proptest-impl", "zebra-network/proptest-impl"]
|
proptest-impl = ["proptest", "proptest-derive", "zebra-chain/proptest-impl", "zebra-state/proptest-impl", "zebra-consensus/proptest-impl", "zebra-network/proptest-impl"]
|
||||||
|
|
||||||
|
@ -75,8 +90,10 @@ rand = { version = "0.8.5", package = "rand" }
|
||||||
sentry-tracing = { version = "0.23.0", optional = true }
|
sentry-tracing = { version = "0.23.0", optional = true }
|
||||||
sentry = { version = "0.23.0", default-features = false, features = ["backtrace", "contexts", "reqwest", "rustls"], optional = true }
|
sentry = { version = "0.23.0", default-features = false, features = ["backtrace", "contexts", "reqwest", "rustls"], optional = true }
|
||||||
|
|
||||||
|
# prod feature release_max_level_info
|
||||||
|
#
|
||||||
# zebrad uses tracing for logging,
|
# zebrad uses tracing for logging,
|
||||||
# we only use `log` to print the static log levels in transitive dependencies
|
# we only use `log` to set and print the static log levels in transitive dependencies
|
||||||
log = "0.4.14"
|
log = "0.4.14"
|
||||||
|
|
||||||
# test feature proptest-impl
|
# test feature proptest-impl
|
||||||
|
|
Loading…
Reference in New Issue