Crate sherr[][src]

Re-exports

pub use backtrace;
pub use log;
pub use anyhow;

Macros

anyhow

Construct an ad-hoc error from a string or existing non-anyhow error value.

bail

Return early with an error.

bail_diag
debug

Logs a message at the debug level.

diag
diag_backtrace
diag_err
diag_position
diag_unimplemented
diag_unimplemented_err
diag_unreachable
diag_unreachable_err
ensure

Return early with an error if a condition is not satisfied.

error

Logs a message at the error level.

format_err

Construct an ad-hoc error from a string or existing non-anyhow error value.

info

Logs a message at the info level.

log

The standard logging macro.

log_enabled

Determines if a message logged at the specified level in that module will be logged.

throw
trace

Logs a message at the trace level.

warn

Logs a message at the warn level.

Structs

Chain

Iterator of a chain of source errors.

Error

The Error type, a wrapper around a dynamic error type.

Metadata

Metadata about a log message.

MetadataBuilder

Builder for Metadata.

ParseLevelError

The type returned by from_str when the string doesn’t match any of the log levels.

Position
Record

The “payload” of a log message.

RecordBuilder

Builder for Record.

SetLoggerError

The type returned by set_logger if set_logger has already been called.

Enums

Level

An enum representing the available verbosity levels of the logger.

LevelFilter

An enum representing the available verbosity level filters of the logger.

Constants

STATIC_MAX_LEVEL

The statically resolved maximum log level.

Traits

Context

Provides the context method for Result.

Log

A trait encapsulating the operations required of a logger.

Functions

logger

Returns a reference to the logger.

max_level

Returns the current maximum log level.

set_logger

Sets the global logger to a &'static Log.

set_logger_racy

A thread-unsafe version of set_logger.

set_max_level

Sets the global maximum log level.

Type Definitions

Result

Result<T, Error>