mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 23:21:02 +00:00
Telemetry per node (#7463)
This commit is contained in:
@@ -24,6 +24,7 @@ mod tests;
|
||||
use futures::{future::BoxFuture, FutureExt, TryFutureExt};
|
||||
use futures::{channel::oneshot, compat::Compat};
|
||||
use sc_rpc_api::{DenyUnsafe, Receiver};
|
||||
use sc_tracing::logging;
|
||||
use sp_utils::mpsc::TracingUnboundedSender;
|
||||
use sp_runtime::traits::{self, Header as HeaderT};
|
||||
|
||||
@@ -200,12 +201,12 @@ impl<B: traits::Block> SystemApi<B::Hash, <B::Header as HeaderT>::Number> for Sy
|
||||
|
||||
fn system_add_log_filter(&self, directives: String) -> std::result::Result<(), rpc::Error> {
|
||||
self.deny_unsafe.check_if_safe()?;
|
||||
sc_tracing::add_directives(&directives);
|
||||
sc_tracing::reload_filter().map_err(|_e| rpc::Error::internal_error())
|
||||
logging::add_directives(&directives);
|
||||
logging::reload_filter().map_err(|_e| rpc::Error::internal_error())
|
||||
}
|
||||
|
||||
fn system_reset_log_filter(&self)-> std::result::Result<(), rpc::Error> {
|
||||
self.deny_unsafe.check_if_safe()?;
|
||||
sc_tracing::reset_log_filter().map_err(|_e| rpc::Error::internal_error())
|
||||
logging::reset_log_filter().map_err(|_e| rpc::Error::internal_error())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,9 +344,7 @@ fn test_add_reset_log_filter() {
|
||||
|
||||
// Enter log generation / filter reload
|
||||
if std::env::var("TEST_LOG_FILTER").is_ok() {
|
||||
sc_cli::init_logger(
|
||||
sc_cli::InitLoggerParams { pattern: "test_before_add=debug".into(), ..Default::default() },
|
||||
).unwrap();
|
||||
sc_tracing::logging::GlobalLoggerBuilder::new("test_before_add=debug").init().unwrap();
|
||||
for line in std::io::stdin().lock().lines() {
|
||||
let line = line.expect("Failed to read bytes");
|
||||
if line.contains("add_reload") {
|
||||
|
||||
Reference in New Issue
Block a user