Crate alto_logger

Source
Expand description

§filtering

Use the ENV variable RUST_LOG with module_name=level

RUST_LOG="tokio=warn,my_module=info,my_module::inner=trace"

A default level can be provided with just level. e.g. RUST_LOG=trace will enable trace for all modules.

You can disable specific modules/crates by using the off level

§optional features

  • time allows formatting a UTC timestamp with the time crate.
    • see the formatting description here time: https://docs.rs/time

Modules§

options
Configuration for various loggers

Structs§

ColorConfig
Color configuration for the logger
FileLogger
std::io::Write based logger, intended for std::fs::File
MultiLogger
A multi-logger
Options
Configuration for the logger
TermLogger
Stdout logger which supports colors

Enums§

Color
The set of available colors for the terminal foreground/background.
Error
An error returned by the logger initialization
StyleConfig
Logger line breaking style
TimeConfig
How the timestamp should be displayed

Functions§

init
Initialize the logger
init_alt_term_logger
Convenience function to create a terminal logger that uses a single-line output, and unix timestamps.
init_term_logger
Convenience function to create a default terminal logger