Struct Config
pub struct Config {
default_level: SerdeLevelFilter,
strict: bool,
targets: HashMap<String, SerdeLevelFilter>,
stdout: Config,
dlt: Option<Config>,
file: Option<Config>,
}Expand description
Logging configuration.
§Example Serialization
default_level = "info" # Optional. Default is "off". One of "off", "error", "warn", "info", "debug", "trace".
strict = false # Optional. Default is false. Whether to be strict about configuration errors.
targets = { "my_crate" = "debug" } # Optional. Default is empty.
[dlt] # Optional. Only available with the "dlt" feature.
# See `dlt::Config`.
[file] # Optional. Only available with the "file" feature.
# See `file::Config`.Fields§
§default_level: SerdeLevelFilter§strict: bool§targets: HashMap<String, SerdeLevelFilter>§stdout: ConfigAvailable on crate feature
§stdout only.dlt: Option<Config>Available on crate feature
§dlt only.file: Option<Config>Available on crate feature
file only.Implementations§
§impl Config
impl Config
pub const fn default_level(&self) -> LevelFilter
pub const fn default_level(&self) -> LevelFilter
Returns the default level filter.
pub fn strict(&self) -> bool
pub fn strict(&self) -> bool
Returns whether we’re in strict mode.
In non-strict mode, some configuration errors may be ignored.
pub fn targets(&self) -> impl Iterator<Item = (&str, LevelFilter)> + '_
pub fn targets(&self) -> impl Iterator<Item = (&str, LevelFilter)> + '_
Returns the target-specific level filters.
pub fn stdout(&self) -> &Config
Available on crate feature stdout only.
pub fn stdout(&self) -> &Config
stdout only.Returns the stdout configuration.
Trait Implementations§
§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more