commit 008a2cf298a5c367568957c9290fd88bee9b44af
parent f0c9a7fbc33f52995dd690da96d53bc2f12e88c1
Author: Daniel GarcĂa <dani-garcia@users.noreply.github.com>
Date: Sun, 8 Oct 2023 14:57:23 +0200
Merge pull request #3859 from stefan0xC/prevent-handlebar-logs
filter handlebars logs
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/main.rs b/src/main.rs
@@ -261,6 +261,13 @@ fn init_logging(level: log::LevelFilter) -> Result<(), fern::InitError> {
log::LevelFilter::Off
};
+ // Only show handlebar logs when the level is Trace
+ let handlebars_level = if level >= log::LevelFilter::Trace {
+ log::LevelFilter::Trace
+ } else {
+ log::LevelFilter::Warn
+ };
+
let mut logger = fern::Dispatch::new()
.level(level)
// Hide unknown certificate errors if using self-signed
@@ -282,6 +289,8 @@ fn init_logging(level: log::LevelFilter) -> Result<(), fern::InitError> {
.level_for("rocket::shield::shield", log::LevelFilter::Warn)
.level_for("hyper::proto", log::LevelFilter::Off)
.level_for("hyper::client", log::LevelFilter::Off)
+ // Filter handlebars logs
+ .level_for("handlebars::render", handlebars_level)
// Prevent cookie_store logs
.level_for("cookie_store", log::LevelFilter::Off)
// Variable level for trust-dns used by reqwest