From a8395da5c933b6083872bd82af82ceba1822b236 Mon Sep 17 00:00:00 2001 From: Franklin Date: Mon, 29 Aug 2022 11:31:46 -0400 Subject: [PATCH] Added a custom log level filter impl --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/utils/logger_util.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1343a45..838b82b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -183,7 +183,7 @@ dependencies = [ [[package]] name = "actix-web-utils" -version = "0.1.3" +version = "0.1.4" dependencies = [ "actix-web", "log", diff --git a/Cargo.toml b/Cargo.toml index 5bef92b..482ee6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-web-utils" -version = "0.1.3" +version = "0.1.4" edition = "2021" authors = ["Franklin E. Blanco"] description = "Just some useful addons for actix web." diff --git a/src/utils/logger_util.rs b/src/utils/logger_util.rs index 8bd490b..6a3f684 100644 --- a/src/utils/logger_util.rs +++ b/src/utils/logger_util.rs @@ -4,7 +4,7 @@ use crate::extensions::logger::SimpleLogger; static LOGGER: SimpleLogger = SimpleLogger; -pub fn init() -> Result<(), SetLoggerError> { +pub fn init(max_log_level_filter: LevelFilter) -> Result<(), SetLoggerError> { log::set_logger(&LOGGER) - .map(|()| log::set_max_level(LevelFilter::Info)) + .map(|()| log::set_max_level(max_log_level_filter)) } \ No newline at end of file