Skip to main content

ToLogParams

Trait ToLogParams 

Source
pub trait ToLogParams<'a>: Sized {
    // Required method
    fn to_log_params(self) -> LogParams<'a>;

    // Provided methods
    fn once(self) -> LogParams<'a> { ... }
    fn skip_first(self) -> LogParams<'a> { ... }
    fn occurs(self, occurs: LogOccurrence) -> LogParams<'a> { ... }
    fn only_if(self, only_if: bool) -> LogParams<'a> { ... }
    fn debug(self) -> LogParams<'a> { ... }
    fn info(self) -> LogParams<'a> { ... }
    fn warn(self) -> LogParams<'a> { ... }
    fn error(self) -> LogParams<'a> { ... }
    fn fatal(self) -> LogParams<'a> { ... }
    fn severity(self, severity: Severity) -> LogParams<'a> { ... }
}
Expand description

rclrs’s ToLogParams: anything a level macro takes as its first argument, and the modifiers that chain off it.

Implemented for &Logger and LogParams; see the module note.

Required Methods§

Source

fn to_log_params(self) -> LogParams<'a>

Convert to params with this value’s settings.

Provided Methods§

Source

fn once(self) -> LogParams<'a>

Emit only the first record of this call site.

Source

fn skip_first(self) -> LogParams<'a>

Emit every record of this call site except the first.

Source

fn occurs(self, occurs: LogOccurrence) -> LogParams<'a>

Set the occurrence rule.

Source

fn only_if(self, only_if: bool) -> LogParams<'a>

Emit only while only_if is true. Combines with an earlier filter by AND, so a chain of conditions all have to hold.

Source

fn debug(self) -> LogParams<'a>

At Debug.

Source

fn info(self) -> LogParams<'a>

At Info.

Source

fn warn(self) -> LogParams<'a>

At Warn.

Source

fn error(self) -> LogParams<'a>

At Error.

Source

fn fatal(self) -> LogParams<'a>

At Fatal.

Source

fn severity(self, severity: Severity) -> LogParams<'a>

At severity.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, 'b: 'a> ToLogParams<'a> for &'a &'b Logger

log_info!(&logger, …) where logger is already a &Logger — the spelling the level macros accepted by deref coercion before they took ToLogParams.

Source§

impl<'a> ToLogParams<'a> for &'a Logger

Source§

impl<'a> ToLogParams<'a> for LogParams<'a>