[][src]Struct holochain_logging::color::ColoredLevelConfig

#[must_use = "builder methods take config by value and thus must be reassigned to variable"]
pub struct ColoredLevelConfig {
    pub error: Color,
    pub warn: Color,
    pub info: Color,
    pub debug: Color,
    pub trace: Color,
}

Fields

error: Color

The color to color logs with the Error level.

warn: Color

The color to color logs with the Warn level.

info: Color

The color to color logs with the Info level.

debug: Color

The color to color logs with the Debug level.

trace: Color

The color to color logs with the Trace level.

Methods

impl ColoredLevelConfig[src]

pub fn new() -> Self[src]

Creates a new ColoredLevelConfig with the default colors.

This matches the behavior of ColoredLevelConfig::default.

pub fn color(self, level: Level) -> WithFgColor<Level>[src]

Colors the given log level with the color in this configuration corresponding to it's level.

The structure returned is opaque, but will print the Level surrounded by ANSI color codes when displayed. This will work correctly for UNIX terminals, but due to a lack of support from the colored crate, this will not function in Windows.

pub fn get_color(self, level: Level) -> Color[src]

Retrieves the color that a log level should be colored as.

Trait Implementations

impl Clone for ColoredLevelConfig[src]

impl Copy for ColoredLevelConfig[src]

impl Default for ColoredLevelConfig[src]

fn default() -> Self[src]

Retrieves the default configuration. This has:

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]