mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 12:17:58 +00:00
Disable log reloading by default (#9966)
* Disable log reloading by default
This disables the log reloading that was enabled by default. The problem
is that the log reload implementation of `tracing` is using a lock to
make the layer replaceable. This lock needs to be locked every time we
need to check if a particular target is enabled (assuming the log level
is high enough). This kills the performance when for example
`sometarget=trace` logging is enabled.
* 🤦
* Remove unused parameter
* Fix test
* Fix
This commit is contained in:
@@ -522,7 +522,6 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
|
||||
dev_key_seed: self.dev_key_seed(is_dev)?,
|
||||
tracing_targets: self.tracing_targets()?,
|
||||
tracing_receiver: self.tracing_receiver()?,
|
||||
disable_log_reloading: self.is_log_filter_reloading_disabled()?,
|
||||
chain_spec,
|
||||
max_runtime_instances,
|
||||
announce_block: self.announce_block()?,
|
||||
@@ -542,9 +541,9 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
|
||||
Ok(self.shared_params().log_filters().join(","))
|
||||
}
|
||||
|
||||
/// Is log reloading disabled (enabled by default)
|
||||
fn is_log_filter_reloading_disabled(&self) -> Result<bool> {
|
||||
Ok(self.shared_params().is_log_filter_reloading_disabled())
|
||||
/// Is log reloading enabled?
|
||||
fn enable_log_reloading(&self) -> Result<bool> {
|
||||
Ok(self.shared_params().enable_log_reloading())
|
||||
}
|
||||
|
||||
/// Should the log color output be disabled?
|
||||
@@ -563,7 +562,7 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
|
||||
sp_panic_handler::set(&C::support_url(), &C::impl_version());
|
||||
|
||||
let mut logger = LoggerBuilder::new(self.log_filters()?);
|
||||
logger.with_log_reloading(!self.is_log_filter_reloading_disabled()?);
|
||||
logger.with_log_reloading(self.enable_log_reloading()?);
|
||||
|
||||
if let Some(tracing_targets) = self.tracing_targets()? {
|
||||
let tracing_receiver = self.tracing_receiver()?;
|
||||
|
||||
Reference in New Issue
Block a user