🔊 (config): Emite avisos de opciones como trazas
This commit is contained in:
parent
91f60a420d
commit
3512fed7e0
8 changed files with 81 additions and 85 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use crate::AutoDefault;
|
||||
use crate::{AutoDefault, trace};
|
||||
|
||||
use serde::{Deserialize, Deserializer};
|
||||
|
||||
|
|
@ -46,17 +46,7 @@ impl<'de> Deserialize<'de> for LangNegotiation {
|
|||
"full" => Self::Full,
|
||||
"noquery" => Self::NoQuery,
|
||||
"configonly" => Self::ConfigOnly,
|
||||
_ => {
|
||||
let default = Self::default();
|
||||
println!(
|
||||
concat!(
|
||||
"\nInvalid value \"{}\" for [app].lang_negotiation. ",
|
||||
"Using \"{:?}\". Check settings.",
|
||||
),
|
||||
raw, default,
|
||||
);
|
||||
default
|
||||
}
|
||||
_ => trace::warn_invalid_setting("[app].lang_negotiation", &raw, Self::default()),
|
||||
};
|
||||
Ok(result)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::AutoDefault;
|
||||
use crate::{AutoDefault, trace};
|
||||
|
||||
use serde::{Deserialize, Deserializer};
|
||||
|
||||
|
|
@ -34,17 +34,7 @@ impl<'de> Deserialize<'de> for LogFormat {
|
|||
"full" => Self::Full,
|
||||
"compact" => Self::Compact,
|
||||
"pretty" => Self::Pretty,
|
||||
_ => {
|
||||
let default = Self::default();
|
||||
println!(
|
||||
concat!(
|
||||
"\nInvalid value \"{}\" for [log].format. ",
|
||||
"Using \"{:?}\". Check settings.",
|
||||
),
|
||||
raw, default,
|
||||
);
|
||||
default
|
||||
}
|
||||
_ => trace::warn_invalid_setting("[log].format", &raw, Self::default()),
|
||||
};
|
||||
Ok(result)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::AutoDefault;
|
||||
use crate::{AutoDefault, trace};
|
||||
|
||||
use serde::{Deserialize, Deserializer};
|
||||
|
||||
|
|
@ -9,10 +9,11 @@ use serde::{Deserialize, Deserializer};
|
|||
/// El valor configurado no distingue entre mayúsculas y minúsculas.
|
||||
#[derive(AutoDefault, Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum LogRolling {
|
||||
/// Escribe las trazas en la salida estándar (sin rotación de archivos).
|
||||
/// Escribe las trazas en la salida estándar (sin rotación de archivos). Es el valor por
|
||||
/// defecto.
|
||||
#[default]
|
||||
Stdout,
|
||||
/// Rotación diaria de archivos de traza.
|
||||
#[default]
|
||||
Daily,
|
||||
/// Rotación horaria de archivos de traza.
|
||||
Hourly,
|
||||
|
|
@ -34,17 +35,7 @@ impl<'de> Deserialize<'de> for LogRolling {
|
|||
"hourly" => Self::Hourly,
|
||||
"minutely" => Self::Minutely,
|
||||
"endless" => Self::Endless,
|
||||
_ => {
|
||||
let default = Self::default();
|
||||
println!(
|
||||
concat!(
|
||||
"\nInvalid value \"{}\" for [log].rolling. ",
|
||||
"Using \"{:?}\". Check settings.",
|
||||
),
|
||||
raw, default,
|
||||
);
|
||||
default
|
||||
}
|
||||
_ => trace::warn_invalid_setting("[log].rolling", &raw, Self::default()),
|
||||
};
|
||||
Ok(result)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::AutoDefault;
|
||||
use crate::{AutoDefault, trace};
|
||||
|
||||
use serde::{Deserialize, Deserializer};
|
||||
|
||||
|
|
@ -33,17 +33,7 @@ impl<'de> Deserialize<'de> for StartupBanner {
|
|||
"small" => Self::Small,
|
||||
"speed" => Self::Speed,
|
||||
"starwars" => Self::Starwars,
|
||||
_ => {
|
||||
let default = Self::default();
|
||||
println!(
|
||||
concat!(
|
||||
"\nInvalid value \"{}\" for [app].startup_banner. ",
|
||||
"Using \"{:?}\". Check settings.",
|
||||
),
|
||||
raw, default,
|
||||
);
|
||||
default
|
||||
}
|
||||
_ => trace::warn_invalid_setting("[app].startup_banner", &raw, Self::default()),
|
||||
};
|
||||
Ok(result)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::AutoDefault;
|
||||
use crate::{AutoDefault, trace};
|
||||
|
||||
use serde::{Deserialize, Deserializer};
|
||||
|
||||
|
|
@ -40,17 +40,7 @@ impl<'de> Deserialize<'de> for TimezoneOrder {
|
|||
"nearest" => Self::Nearest,
|
||||
"alphabetical" => Self::Alphabetical,
|
||||
"listed" => Self::Listed,
|
||||
_ => {
|
||||
let default = Self::default();
|
||||
println!(
|
||||
concat!(
|
||||
"\nInvalid value \"{}\" for [app].timezone_order. ",
|
||||
"Using \"{:?}\". Check settings.",
|
||||
),
|
||||
raw, default,
|
||||
);
|
||||
default
|
||||
}
|
||||
_ => trace::warn_invalid_setting("[app].timezone_order", &raw, Self::default()),
|
||||
};
|
||||
Ok(result)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue