Avoid local variables if not necessary

We can initialize the env filter without `format!` when the variables
are not used anywhere else.
This commit is contained in:
Thomas Eizinger 2021-03-29 09:50:15 +11:00
parent c01cccb288
commit 96c87bca71
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

View File

@ -7,16 +7,8 @@ use tracing::subscriber::DefaultGuard;
/// let _guard = init_tracing(); /// let _guard = init_tracing();
/// ``` /// ```
pub fn init_tracing() -> DefaultGuard { pub fn init_tracing() -> DefaultGuard {
let global_filter = tracing::Level::WARN;
let test_filter = tracing::Level::DEBUG;
let monero_harness_filter = tracing::Level::DEBUG;
let monero_rpc_filter = tracing::Level::DEBUG;
use tracing_subscriber::util::SubscriberInitExt as _; use tracing_subscriber::util::SubscriberInitExt as _;
tracing_subscriber::fmt() tracing_subscriber::fmt()
.with_env_filter(format!( .with_env_filter("warn,test=debug,monero_harness=debug,monero_rpc=debug")
"{},test={},monero_harness={},monero_rpc={}",
global_filter, test_filter, monero_harness_filter, monero_rpc_filter,
))
.set_default() .set_default()
} }