use std::{ffi::OsString, path::Path};
#[derive(Debug, Clone, Copy)]
pub struct LoggingSettings<'a> {
pub log: &'a Path,
pub unicode: bool,
pub append: bool,
}
impl<'a> From<&'a LoggingSettings<'a>> for OsString {
fn from(ls: &'a LoggingSettings<'a>) -> Self {
OsString::from(
String::from("/") +
if ls.unicode { "uni" } else { "" } +
"log" + if ls.append { "+" } else { "" } +
":" +
ls.log.to_str().unwrap()
)
}
}
impl<'a> From<LoggingSettings<'a>> for OsString {
fn from(ls: LoggingSettings<'a>) -> Self {
(&ls).into()
}
}