diff --git a/substrate/bin/node-template/node/src/command.rs b/substrate/bin/node-template/node/src/command.rs index 585b8e1ca8..e7e386703d 100644 --- a/substrate/bin/node-template/node/src/command.rs +++ b/substrate/bin/node-template/node/src/command.rs @@ -21,8 +21,7 @@ use crate::chain_spec; use crate::cli::Cli; /// Parse and run command line arguments -pub fn run(version: VersionInfo) -> error::Result<()> -{ +pub fn run(version: VersionInfo) -> error::Result<()> { let opt = sc_cli::from_args::(&version); let config = sc_service::Configuration::new(&version); diff --git a/substrate/bin/node/cli/src/command.rs b/substrate/bin/node/cli/src/command.rs index f5d747a146..0e9b23b73e 100644 --- a/substrate/bin/node/cli/src/command.rs +++ b/substrate/bin/node/cli/src/command.rs @@ -57,9 +57,9 @@ where } // Setup tracing. - if let Some(tracing_targets) = cli_args.shared_params.tracing_targets.as_ref() { + if let Some(tracing_targets) = cli_args.import_params.tracing_targets.as_ref() { let subscriber = sc_tracing::ProfilingSubscriber::new( - cli_args.shared_params.tracing_receiver.into(), tracing_targets + cli_args.import_params.tracing_receiver.into(), tracing_targets ); if let Err(e) = tracing::subscriber::set_global_default(subscriber) { panic!("Unable to set global default subscriber {}", e); diff --git a/substrate/client/cli/src/lib.rs b/substrate/client/cli/src/lib.rs index 0965a79f15..735f8cb27a 100644 --- a/substrate/client/cli/src/lib.rs +++ b/substrate/client/cli/src/lib.rs @@ -270,8 +270,7 @@ where /// 1. set the panic handler /// 2. raise the FD limit /// 3. initialize the logger -pub fn init(shared_params: &SharedParams, version: &VersionInfo) -> error::Result<()> -{ +pub fn init(shared_params: &SharedParams, version: &VersionInfo) -> error::Result<()> { let full_version = sc_service::config::full_version_from_strs( version.version, version.commit @@ -638,8 +637,8 @@ where config.telemetry_endpoints = Some(TelemetryEndpoints::new(cli.telemetry_endpoints)); } - config.tracing_targets = cli.shared_params.tracing_targets.into(); - config.tracing_receiver = cli.shared_params.tracing_receiver.into(); + config.tracing_targets = cli.import_params.tracing_targets.into(); + config.tracing_receiver = cli.import_params.tracing_receiver.into(); // Imply forced authoring on --dev config.force_authoring = cli.shared_params.dev || cli.force_authoring; diff --git a/substrate/client/cli/src/params.rs b/substrate/client/cli/src/params.rs index 1dc6b0567c..ddded79142 100644 --- a/substrate/client/cli/src/params.rs +++ b/substrate/client/cli/src/params.rs @@ -113,20 +113,6 @@ pub struct SharedParams { /// Sets a custom logging filter. #[structopt(short = "l", long = "log", value_name = "LOG_PATTERN")] pub log: Option, - - /// Comma separated list of targets for tracing - #[structopt(long = "tracing-targets", value_name = "TARGETS")] - pub tracing_targets: Option, - - /// Receiver to process tracing messages - #[structopt( - long = "tracing-receiver", - value_name = "RECEIVER", - possible_values = &TracingReceiver::variants(), - case_insensitive = true, - default_value = "Log" - )] - pub tracing_receiver: TracingReceiver, } /// Parameters for block import. @@ -169,6 +155,20 @@ pub struct ImportParams { /// Specify the state cache size. #[structopt(long = "state-cache-size", value_name = "Bytes", default_value = "67108864")] pub state_cache_size: usize, + + /// Comma separated list of targets for tracing + #[structopt(long = "tracing-targets", value_name = "TARGETS")] + pub tracing_targets: Option, + + /// Receiver to process tracing messages + #[structopt( + long = "tracing-receiver", + value_name = "RECEIVER", + possible_values = &TracingReceiver::variants(), + case_insensitive = true, + default_value = "Log" + )] + pub tracing_receiver: TracingReceiver, } /// Parameters used to create the network configuration.