Trait logchop::OptionLogger [−][src]
Augment Option
types with log methods that can print Debug
representations of wrapped
values. If the type being logged does not implement Debug
, use OptionLogFormatter
instead.
This trait defines methods prefixed by the log level, as well as a general one that accepts a log level parameter.
<log_level>(message)
appends the option to the message ifSome
, or prints the message ifNone
<log_level>_some(message)
appends the wrapped value to the message ifSome
<log_level>_none()
outputs the message ifNone
Required methods
fn log(self, level: Level, message: &str) -> Option<T>
[src]
Output a log message of the provided severity if Some
or None
. If Some
, the wrapped
value will be appended.
fn log_some(self, level: Level, message: &str) -> Option<T>
[src]
Output a log message of the provided severity if Some
, with the wrapped value appended.
fn log_none(self, level: Level, message: &str) -> Option<T>
[src]
Output a log message of the provided severity if None
.
fn trace(self, message: &str) -> Option<T>
[src]
Output a
trace
log with the given message. This will optionally append the wrapped value if Some
.
fn trace_some(self, message: &str) -> Option<T>
[src]
Output a
trace
log with the given message if Some
, appending the wrapped value.
fn trace_none(self, message: &str) -> Option<T>
[src]
Output a
trace
log with the given message if None
.
fn debug(self, message: &str) -> Option<T>
[src]
Output a
debug
log with the given message. This will optionally append the wrapped value if Some
.
fn debug_some(self, message: &str) -> Option<T>
[src]
Output a
debug
log with the given message if Some
, appending the wrapped value.
fn debug_none(self, message: &str) -> Option<T>
[src]
Output a
debug
log with the given message if None
.
fn info(self, message: &str) -> Option<T>
[src]
Output a
info
log with the given message. This will optionally append the wrapped value if Some
.
fn info_some(self, message: &str) -> Option<T>
[src]
Output a
info
log with the given message if Some
, appending the wrapped value.
fn info_none(self, message: &str) -> Option<T>
[src]
Output a
info
log with the given message if None
.
fn warn(self, message: &str) -> Option<T>
[src]
Output a
warn
log with the given message. This will optionally append the wrapped value if Some
.
fn warn_some(self, message: &str) -> Option<T>
[src]
Output a
warn
log with the given message if Some
, appending the wrapped value.
fn warn_none(self, message: &str) -> Option<T>
[src]
Output a
warn
log with the given message if None
.
fn error(self, message: &str) -> Option<T>
[src]
Output a
error
log with the given message. This will optionally append the wrapped value if Some
.
fn error_some(self, message: &str) -> Option<T>
[src]
Output a
error
log with the given message if Some
, appending the wrapped value.
fn error_none(self, message: &str) -> Option<T>
[src]
Output a
error
log with the given message if None
.
Implementations on Foreign Types
impl<T> OptionLogger<T> for Option<T> where
T: Debug,
[src]
T: Debug,