Expand description
logging provides Logger implementations suitable for either command-line applications or serving daemons.
Modules
write provides adapters to use anything which implements Write as a logging
destination.
Structs
A LogFilter is a single filter, perhaps one of many, that can be applied to
log messages before actually outputting them.
LogFilters is a structure which defines the full set of filters a Logger
should apply to log messages before actually outputting them.
This is the standard Log implementation bdrck provides, which can be
controlled by setting its Options. In general, this is intended to be a
pretty versatile implementation, suitable for both command-line applications
as well as serving daemons, given the right Options.
Options is a structure which describes the options for a Logger. Generally
these should be constructed using OptionsBuilder, instead of filling in all
fields by hand.
OptionsBuilder provides a builder-style interface to construct an Options.
Functions
This function formats the given log Record into a string, which can then be
written directly to the logging sink (e.g. stderr, a file, etc.).
This is a shortcut which just calls try_init(), but implicitly unwraps the
resulting error. For applications which initialize a Logger first thing in
main(), this is probably a reasonable choice.
This is a utility function which provides a way to parse a log::LevelFilter
from a string. Upstream doesn’t impl FromStr for this type, so this extra
utility is necessary.
Try to set up a new global Logger, with the given Options controlling its
behavior, returning a standard error if doing so fails in some way.