Skip to main content

Crate trivial_log

Crate trivial_log 

Source
Expand description

§trivial_log

This is intended to be a no-bloat implementation for log. It includes simple defaults while still providing good flexibility for more advanced use cases.

§Example

  trivial_log::init_std(log::LevelFilter::Trace).unwrap();
  log::error!("An error has occurred, please help!");

Structs§

AppenderBuilder
Builder for adding appenders to a format Fn.
Builder
Builder for configuring trivial_log. Use trivial_log::builder() to obtain a new instance of this struct.

Enums§

Error

Traits§

Appender
This trait defines an appender which consumes a formatted log message of type T and will “write” it to somewhere like stdout/disk/network/…
IntoAppender
Custom “Into” trait that produces an Arc<dyn Appender<T>. This trait does not usually need to implemented manually. It is implemented for all Appender structs by default.

Functions§

builder
free
This fn will remove all formats and appenders from the log impl making it essentially a noop.
init_std
Initializes log to forward all warn and below to stdout and all error to stderr
init_stderr
Initializes log to forward all log to stderr using the default format
init_stdout
Initializes log to forward all log to stdout using the default format