Added a custom log level filter impl
This commit is contained in:
parent
98987bda30
commit
a8395da5c9
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -183,7 +183,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-web-utils"
|
name = "actix-web-utils"
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"log",
|
"log",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-web-utils"
|
name = "actix-web-utils"
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Franklin E. Blanco"]
|
authors = ["Franklin E. Blanco"]
|
||||||
description = "Just some useful addons for actix web."
|
description = "Just some useful addons for actix web."
|
||||||
|
@ -4,7 +4,7 @@ use crate::extensions::logger::SimpleLogger;
|
|||||||
|
|
||||||
static LOGGER: SimpleLogger = SimpleLogger;
|
static LOGGER: SimpleLogger = SimpleLogger;
|
||||||
|
|
||||||
pub fn init() -> Result<(), SetLoggerError> {
|
pub fn init(max_log_level_filter: LevelFilter) -> Result<(), SetLoggerError> {
|
||||||
log::set_logger(&LOGGER)
|
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
Block a user