From 9e8dd15a9942bc73a3fdcad4d0c46c711be6f78a Mon Sep 17 00:00:00 2001 From: laanwj <126646+laanwj@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:45:47 +0200 Subject: [PATCH] cln-plugin: Change default log level filter back to INFO In commit 60e1532dd89ec8a434ce4b31359c54558c41b4b1 (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 #7658. Changelog-Fixed: cln-plugin: Change default log level filter back to INFO --- plugins/src/logging.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/src/logging.rs b/plugins/src/logging.rs index 9534fb7f89ec..0da958c1331c 100644 --- a/plugins/src/logging.rs +++ b/plugins/src/logging.rs @@ -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()