jenslog-rs/src/logging/logger.rs
LordMZTE 277de089db rename logger module to logging
this prevents the module from having the same name as its parant
and makes the linter happy
2020-08-25 23:44:18 +02:00

14 lines
340 B
Rust

use winapi::um::winuser::KBDLLHOOKSTRUCT;
use crate::logging::loggers::{ConsoleLogger, FileLogger};
pub trait Logger: Sync {
fn log(&self, key: &KBDLLHOOKSTRUCT);
}
pub fn get_logger(name: &str) -> Box<dyn Logger> {
match name {
"file" => Box::new(FileLogger::new_default()),
_ => Box::new(ConsoleLogger),
}
}