style: 💄 fmt+lint
This commit is contained in:
parent
e9185a0fb0
commit
37296f8fc5
@ -1,5 +1,7 @@
|
|||||||
use eyre::Result;
|
use {
|
||||||
use lool::logger::{debug, error, info, trace, warn, ConsoleLogger, Level};
|
eyre::Result,
|
||||||
|
lool::logger::{debug, error, info, trace, warn, ConsoleLogger, Level},
|
||||||
|
};
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
ConsoleLogger::builder()
|
ConsoleLogger::builder()
|
||||||
|
|||||||
@ -120,7 +120,7 @@ impl ConsoleLogger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// returns true if the context should be ignored
|
/// returns true if the context should be ignored
|
||||||
fn should_ignore(&self, ctx: &String) -> bool {
|
fn should_ignore(&self, ctx: &str) -> bool {
|
||||||
for glob in &self.ctx_ignore_globs {
|
for glob in &self.ctx_ignore_globs {
|
||||||
if glob_match(glob, ctx) {
|
if glob_match(glob, ctx) {
|
||||||
return true;
|
return true;
|
||||||
@ -270,7 +270,7 @@ impl SetupBuilder {
|
|||||||
let logger = Box::new(ConsoleLogger {
|
let logger = Box::new(ConsoleLogger {
|
||||||
name: self.name.unwrap_or("".to_string()),
|
name: self.name.unwrap_or("".to_string()),
|
||||||
time_fn: self.time_fn.unwrap_or(datetime::utc_current_time),
|
time_fn: self.time_fn.unwrap_or(datetime::utc_current_time),
|
||||||
ctx_ignore_globs: self.ctx_ignore_globs.unwrap_or(vec![]),
|
ctx_ignore_globs: self.ctx_ignore_globs.unwrap_or_default(),
|
||||||
});
|
});
|
||||||
log::set_logger(Box::leak(logger) as &'static dyn Log)
|
log::set_logger(Box::leak(logger) as &'static dyn Log)
|
||||||
.map(|()| log::set_max_level(self.max_level.unwrap().to_level_filter()))
|
.map(|()| log::set_max_level(self.max_level.unwrap().to_level_filter()))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user