pub struct Config {
pub output: OutputMode,
pub theme: HashMap<Level, Style>,
}Expand description
Configuration for the XMT logger.
Fields§
§output: OutputModeThe output mode.
Used to determine how to print values emitted with xmt::out!.
theme: HashMap<Level, Style>The theme to use for the output.
The theme is not taken into account when not outputing to a TTY.
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_style(self, level: Level, style: Style) -> Self
pub fn with_style(self, level: Level, style: Style) -> Self
Set the style for a given log level.
Overwrites any previously set style for the given level.
§Examples
use xmt::{Color, Config, Level, Style};
Config::default().with_style(Level::Normal, Style::new(Color::Red));Sourcepub fn with_json_output(self) -> Self
pub fn with_json_output(self) -> Self
Enables JSON output
Mutually exclusive with xmt::Config::with_tree_output.
Sourcepub fn with_tree_output(self) -> Self
pub fn with_tree_output(self) -> Self
Enables tree output
Mutually exclusive with xmt::Config::with_json_output.
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.