[][src]Struct imxrt_uart_log::LoggingConfig

pub struct LoggingConfig {
    pub max_level: LevelFilter,
    pub filters: &'static [Filter],
}

Logging configuration

Allows a user to specify certain configurations of the logging system. By default, the max log level is the log level set at compile time. See the compile time filters section for more information. We also enable logging for all targets. Set the filters collection to specify log targets of interest.

If the default configuration is good for you, use Default::default().

use imxrt_uart_log::{Filter, LoggingConfig};

const I2C_LOGGING: Filter = ("i2c", None);
const SPI_LOGGING: Filter = ("spi", Some(log::LevelFilter::Warn));
const MOTOR_LOGGING: Filter = ("motor", Some(log::LevelFilter::Trace));

let config = LoggingConfig {
    max_level: log::LevelFilter::Debug,
    filters: &[
        I2C_LOGGING,
        SPI_LOGGING,
        MOTOR_LOGGING,
    ]
};

Fields

max_level: LevelFilter

The max log level for all logging

By default, we select the static max level. Users may override this if they'd like to bypass the statically-assigned max level

filters: &'static [Filter]

A list of filtered targets to log.

If set to an empty slice (default), the logger performs no filtering. Otherwise, we filter the specified targets by the accompanying log level. See Filter for more information.

Trait Implementations

impl Default for LoggingConfig[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.