Trait logchop::ResultLogger [−][src]
Augment Result
types with log methods that can print debug representations of wrapped
values. If the wrapped Ok
or Err
types do not implement Debug
, use ResultLogFormatter
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 ifOk
orErr
<log_level>_ok(message)
appends the wrapped value to the message ifOk
<log_level>_err(message)
appends the wrapped value to the message ifErr
Required methods
fn log(self, level: Level, message: &str) -> Result<T, E>
[src]
Output a log message of the provided severity if Ok
or Err
. The wrapped value will be
appended.
fn log_ok(self, level: Level, message: &str) -> Result<T, E>
[src]
Output a log message of the provided severity if Ok
. The wrapped value will be appended.
fn log_err(self, level: Level, message: &str) -> Result<T, E>
[src]
Output a log message of the provided severity if Err
. The wrapped value will be appended.
fn trace(self, message: &str) -> Result<T, E>
[src]
Output a trace log with the given message. This will append the wrapped value.
fn trace_ok(self, message: &str) -> Result<T, E>
[src]
Output a
trace
log with the given message if Ok
, appending the wrapped value.
fn trace_err(self, message: &str) -> Result<T, E>
[src]
Output a
trace
log with the given message if Err
, appending the wrapped value.
fn debug(self, message: &str) -> Result<T, E>
[src]
Output a debug log with the given message. This will append the wrapped value.
fn debug_ok(self, message: &str) -> Result<T, E>
[src]
Output a
debug
log with the given message if Ok
, appending the wrapped value.
fn debug_err(self, message: &str) -> Result<T, E>
[src]
Output a
debug
log with the given message if Err
, appending the wrapped value.
fn info(self, message: &str) -> Result<T, E>
[src]
Output a info log with the given message. This will append the wrapped value.
fn info_ok(self, message: &str) -> Result<T, E>
[src]
Output a
info
log with the given message if Ok
, appending the wrapped value.
fn info_err(self, message: &str) -> Result<T, E>
[src]
Output a
info
log with the given message if Err
, appending the wrapped value.
fn warn(self, message: &str) -> Result<T, E>
[src]
Output a warn log with the given message. This will append the wrapped value.
fn warn_ok(self, message: &str) -> Result<T, E>
[src]
Output a
warn
log with the given message if Ok
, appending the wrapped value.
fn warn_err(self, message: &str) -> Result<T, E>
[src]
Output a
warn
log with the given message if Err
, appending the wrapped value.
fn error(self, message: &str) -> Result<T, E>
[src]
Output a error log with the given message. This will append the wrapped value.
fn error_ok(self, message: &str) -> Result<T, E>
[src]
Output a
error
log with the given message if Ok
, appending the wrapped value.
fn error_err(self, message: &str) -> Result<T, E>
[src]
Output a
error
log with the given message if Err
, appending the wrapped value.
Implementations on Foreign Types
impl<T, E> ResultLogger<T, E> for Result<T, E> where
T: Debug,
E: Debug,
[src]
T: Debug,
E: Debug,