Struct log::Metadata [−][src]
pub struct Metadata<'a> { /* fields omitted */ }Metadata about a log message.
Use
Metadata structs are created when users of the library use
logging macros.
They are consumed by implementations of the Log trait in the
enabled method.
Records use Metadata to determine the log message’s severity
and target.
Users should use the log_enabled! macro in their code to avoid
constructing expensive log messages.
Examples
ⓘ
use log::{Record, Level, Metadata}; struct MyLogger; impl log::Log for MyLogger { fn enabled(&self, metadata: &Metadata) -> bool { metadata.level() <= Level::Info } fn log(&self, record: &Record) { if self.enabled(record.metadata()) { println!("{} - {}", record.level(), record.args()); } } fn flush(&self) {} }
Implementations
impl<'a> Metadata<'a>[src]
impl<'a> Metadata<'a>[src]Trait Implementations
impl<'a> PartialOrd<Metadata<'a>> for Metadata<'a>[src]
impl<'a> PartialOrd<Metadata<'a>> for Metadata<'a>[src]fn partial_cmp(&self, other: &Metadata<'a>) -> Option<Ordering>[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> bool