Remove logging file from config (was never implemented)

This commit is contained in:
Tobias Reisinger 2024-06-11 17:46:35 +02:00
parent d4ff664f74
commit 41cc9e0622
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
2 changed files with 4 additions and 6 deletions

View file

@ -16,7 +16,6 @@ pub struct Server {
#[allow(unused)]
pub struct Logging {
pub level: String,
pub file: String,
}
#[derive(Clone, Debug, Deserialize, Default)]
@ -40,7 +39,6 @@ impl Default for Logging {
fn default() -> Self {
Logging {
level: String::from("info"),
file: String::from("stdout"),
}
}
}

View file

@ -7,12 +7,12 @@ use log::LevelFilter;
use simple_logger::SimpleLogger;
use crate::errors::EmgauwaError;
use crate::settings::Permissions;
use crate::settings::{Logging, Permissions};
use crate::types::RelayStates;
pub fn init_logging(level: &str) -> Result<(), EmgauwaError> {
let log_level: LevelFilter = LevelFilter::from_str(level)
.map_err(|_| EmgauwaError::Other(format!("Invalid log level: {}", level)))?;
pub fn init_logging(logging: &Logging) -> Result<(), EmgauwaError> {
let log_level: LevelFilter = LevelFilter::from_str(&logging.level)
.map_err(|_| EmgauwaError::Other(format!("Invalid log level: {}", logging.level)))?;
log::trace!("Log level set to {:?}", log_level);
SimpleLogger::new()