better inputs, log config
This commit is contained in:
14
src/config.rs
Normal file
14
src/config.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use serde_derive::{Serialize, Deserialize};
|
||||
use toml;
|
||||
use std::fs;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct LogConfig {
|
||||
pub input: bool
|
||||
}
|
||||
|
||||
impl LogConfig {
|
||||
pub fn from_file(path: &str) -> Self {
|
||||
toml::from_slice(&fs::read(path).expect("Failed to read log config!")).expect("Failed to parse log config!")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user