Skip to content

Commit

Permalink
chore(logging): update docs for changing log levels
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandSherwin committed Jun 26, 2024
1 parent 27cc5d2 commit ba7e252
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions sn_logging/src/layers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ pub struct ReloadHandle(pub(crate) Handle<Box<dyn Filter<Registry> + Send + Sync

impl ReloadHandle {
/// Modify the log level to the provided CSV value
/// Example input: `libp2p=DEBUG, tokio=INFO, all, sn_client=ERROR`
/// If any custom keyword is encountered in the CSV, for e.g., VERBOSE_SN_LOGS ('all'), then they will override some
/// of the value that you might have provided, `sn_client=ERROR` in the above example will be ignored and
/// instead will be set to `TRACE` since `all` keyword is provided.
/// Example input: `libp2p=DEBUG,tokio=INFO,all,sn_client=ERROR`
///
/// Custom keywords will take less precedence if the same target has been manually specified in the CSV.
/// `sn_client=ERROR` in the above example will be used instead of the TRACE level set by "all" keyword.
pub fn modify_log_level(&self, logging_value: &str) -> Result<()> {
let targets: Vec<(String, Level)> = get_logging_targets(logging_value)?;
self.0.modify(|old_filter| {
Expand Down
5 changes: 3 additions & 2 deletions sn_node_rpc_client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ enum Cmd {
/// Update the node's log levels.
#[clap(name = "log")]
Log {
/// Change the log level of the safenode.
/// Change the log level of the safenode. This accepts a comma-separated list of log levels for different modules
/// or specific keywords like "all" or "v".
///
/// Example: --level SN_LOG=all,RUST_LOG=libp2p=debug
/// Example: --level libp2p=DEBUG,tokio=INFO,all,sn_client=ERROR
#[clap(name = "level", long)]
log_level: String,
},
Expand Down

0 comments on commit ba7e252

Please sign in to comment.