pub struct LoggingConfig {
pub max_level: LevelFilter,
pub filters: &'static [Filter],
}Expand description
Logging configuration
Use this 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. The frontend also enables 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_log::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: LevelFilterThe max log level for all logging
This is the static max level. You may override this 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, the frontend filters the specified targets by
the accompanying log level. See Filter for
more information.
Implementations§
Source§impl LoggingConfig
impl LoggingConfig
Trait Implementations§
Source§impl Default for LoggingConfig
impl Default for LoggingConfig
Source§fn default() -> LoggingConfig
fn default() -> LoggingConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LoggingConfig
impl RefUnwindSafe for LoggingConfig
impl Send for LoggingConfig
impl Sync for LoggingConfig
impl Unpin for LoggingConfig
impl UnsafeUnpin for LoggingConfig
impl UnwindSafe for LoggingConfig
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