Added a custom log level filter impl
This commit is contained in:
parent
98987bda30
commit
a8395da5c9
|
@ -183,7 +183,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "actix-web-utils"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
dependencies = [
|
||||
"actix-web",
|
||||
"log",
|
||||
|
|
|
@ -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."
|
||||
|
|
|
@ -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))
|
||||
}
|
Loading…
Reference in New Issue