Skip to content

Commit

Permalink
cln-plugin: Change default log level filter back to INFO
Browse files Browse the repository at this point in the history
In commit 60e1532 (released in crate 0.1.8), which switched the
logging framework to tracing-subscriber, the default log level filter
was (accidentally) set to ERROR and above, instead of INFO and above.

Change this back to INFO as it was before. It can still be overridden
with CLN_PLUGIN_LOG.

Follows the example in https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#method.from_env

Closes ElementsProject#7658.

Changelog-Fixed: cln-plugin: Change default log level filter back to INFO
  • Loading branch information
laanwj authored and rustyrussell committed Sep 17, 2024
1 parent bfe0557 commit 9e8dd15
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ mod trace {
where
O: AsyncWrite + Send + Unpin + 'static,
{
let filter = tracing_subscriber::filter::EnvFilter::from_env("CLN_PLUGIN_LOG");
let filter = tracing_subscriber::filter::EnvFilter::builder()
.with_default_directive(tracing_subscriber::filter::LevelFilter::INFO.into())
.with_env_var("CLN_PLUGIN_LOG")
.from_env_lossy();
let sender = start_writer(out);

tracing_subscriber::registry()
Expand Down

0 comments on commit 9e8dd15

Please sign in to comment.