mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-13 11:35:50 +00:00
Set max log level when changing the log directives via RPC (#8721)
Before this pr changing the log directives would not change the max log level. This means that if the node was started with `info` logging and some `trace` logging was enabled, this `trace` wouldn't be logged. To fix this we also need to update the max log level. This max log level is used by the log macros to early return.
This commit is contained in:
@@ -81,11 +81,12 @@ pub fn reload_filter() -> Result<(), String> {
|
||||
}
|
||||
}
|
||||
}
|
||||
env_filter = env_filter.add_directive(
|
||||
"sc_tracing=trace"
|
||||
.parse()
|
||||
.expect("provided directive is valid"),
|
||||
);
|
||||
|
||||
// Set the max logging level for the `log` macros.
|
||||
let max_level_hint =
|
||||
tracing_subscriber::Layer::<tracing_subscriber::FmtSubscriber>::max_level_hint(&env_filter);
|
||||
log::set_max_level(super::to_log_level_filter(max_level_hint));
|
||||
|
||||
log::debug!(target: "tracing", "Reloading log filter with: {}", env_filter);
|
||||
FILTER_RELOAD_HANDLE
|
||||
.get()
|
||||
|
||||
Reference in New Issue
Block a user