Remove logging file from config (was never implemented)
This commit is contained in:
parent
d4ff664f74
commit
41cc9e0622
2 changed files with 4 additions and 6 deletions
|
@ -16,7 +16,6 @@ pub struct Server {
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub struct Logging {
|
pub struct Logging {
|
||||||
pub level: String,
|
pub level: String,
|
||||||
pub file: String,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Default)]
|
#[derive(Clone, Debug, Deserialize, Default)]
|
||||||
|
@ -40,7 +39,6 @@ impl Default for Logging {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Logging {
|
Logging {
|
||||||
level: String::from("info"),
|
level: String::from("info"),
|
||||||
file: String::from("stdout"),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,12 @@ use log::LevelFilter;
|
||||||
use simple_logger::SimpleLogger;
|
use simple_logger::SimpleLogger;
|
||||||
|
|
||||||
use crate::errors::EmgauwaError;
|
use crate::errors::EmgauwaError;
|
||||||
use crate::settings::Permissions;
|
use crate::settings::{Logging, Permissions};
|
||||||
use crate::types::RelayStates;
|
use crate::types::RelayStates;
|
||||||
|
|
||||||
pub fn init_logging(level: &str) -> Result<(), EmgauwaError> {
|
pub fn init_logging(logging: &Logging) -> Result<(), EmgauwaError> {
|
||||||
let log_level: LevelFilter = LevelFilter::from_str(level)
|
let log_level: LevelFilter = LevelFilter::from_str(&logging.level)
|
||||||
.map_err(|_| EmgauwaError::Other(format!("Invalid log level: {}", level)))?;
|
.map_err(|_| EmgauwaError::Other(format!("Invalid log level: {}", logging.level)))?;
|
||||||
log::trace!("Log level set to {:?}", log_level);
|
log::trace!("Log level set to {:?}", log_level);
|
||||||
|
|
||||||
SimpleLogger::new()
|
SimpleLogger::new()
|
||||||
|
|
Loading…
Reference in a new issue