pub trait ToLogParams<'a>: Sized {
Show 13 methods
// 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 throttle(self, throttle: Duration) -> LogParams<'a> { ... }
fn throttle_clock(self, clock: ThrottleClock<'a>) -> 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: LogSeverity) -> LogParams<'a> { ... }
}
Expand description
Required Methods§
Sourcefn to_log_params(self) -> LogParams<'a>
fn to_log_params(self) -> LogParams<'a>
Convert the object into LogParams with default settings
Provided Methods§
Sourcefn skip_first(self) -> LogParams<'a>
fn skip_first(self) -> LogParams<'a>
The first time the logging happens, we should skip it
Sourcefn occurs(self, occurs: LogOccurrence) -> LogParams<'a>
fn occurs(self, occurs: LogOccurrence) -> LogParams<'a>
Set the occurrence behavior of the log instance
Sourcefn throttle(self, throttle: Duration) -> LogParams<'a>
fn throttle(self, throttle: Duration) -> LogParams<'a>
Set a throttling interval during which this log will not publish. A value of zero will never block the message from being published, and this is the default behavior.
A negative duration is not valid, but will be treated as a zero duration.
Sourcefn throttle_clock(self, clock: ThrottleClock<'a>) -> LogParams<'a>
fn throttle_clock(self, clock: ThrottleClock<'a>) -> LogParams<'a>
Set the clock that will be used to control throttling.
Sourcefn only_if(self, only_if: bool) -> LogParams<'a>
fn only_if(self, only_if: bool) -> LogParams<'a>
The log will not be published if a false
expression is passed into
this function.
Other factors may prevent the log from being published if a true
is
passed in, such as ToLogParams::throttle
or ToLogParams::once
filtering the log.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.