mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 22:47:56 +00:00
Rework telemetry to replace the use of tracing with an object we pass around (#8143)
polkadot companion: paritytech/polkadot#2535
This commit is contained in:
@@ -24,7 +24,6 @@ use sc_service::{
|
||||
GenericChainSpec, RuntimeGenesis,
|
||||
KeepBlocks, TransactionStorageMode,
|
||||
};
|
||||
use sc_telemetry::TelemetryHandle;
|
||||
use sc_tracing::logging::LoggerBuilder;
|
||||
use wasm_bindgen::prelude::*;
|
||||
use futures::{
|
||||
@@ -37,13 +36,8 @@ use libp2p_wasm_ext::{ExtTransport, ffi};
|
||||
pub use console_error_panic_hook::set_once as set_console_error_panic_hook;
|
||||
|
||||
/// Initialize the logger and return a `TelemetryWorker` and a wasm `ExtTransport`.
|
||||
pub fn init_logging_and_telemetry(
|
||||
pattern: &str,
|
||||
) -> Result<sc_telemetry::TelemetryWorker, sc_tracing::logging::Error> {
|
||||
let transport = ExtTransport::new(ffi::websocket_transport());
|
||||
let mut logger = LoggerBuilder::new(pattern);
|
||||
logger.with_transport(transport);
|
||||
logger.init()
|
||||
pub fn init_logging(pattern: &str) -> Result<(), sc_tracing::logging::Error> {
|
||||
LoggerBuilder::new(pattern).init()
|
||||
}
|
||||
|
||||
/// Create a service configuration from a chain spec.
|
||||
@@ -51,7 +45,6 @@ pub fn init_logging_and_telemetry(
|
||||
/// This configuration contains good defaults for a browser light client.
|
||||
pub async fn browser_configuration<G, E>(
|
||||
chain_spec: GenericChainSpec<G, E>,
|
||||
telemetry_handle: Option<TelemetryHandle>,
|
||||
) -> Result<Configuration, Box<dyn std::error::Error>>
|
||||
where
|
||||
G: RuntimeGenesis + 'static,
|
||||
@@ -82,7 +75,6 @@ where
|
||||
async {}
|
||||
}).into(),
|
||||
telemetry_external_transport: Some(transport),
|
||||
telemetry_handle,
|
||||
role: Role::Light,
|
||||
database: {
|
||||
info!("Opening Indexed DB database '{}'...", name);
|
||||
|
||||
Reference in New Issue
Block a user