MHlog is a simple, thread-safe logging library.
toml
[dependencies]
mhlog = "2.1.0"
```rust extern crate mhlog;
use mhlog::{log,info,warn,err};
log!("Log message. Prefixed with a timestamp. It's {}", "thread-safe!");
info!("Logging message prefixed by '
Writes log messages to stdout
/stderr
. The writes are thread-safe.
If an error occurs when writing to the log file it panics.
Provided logging macros:
log!()
info!()
warn!()
err!()
By default all log messages are printed to stderr. To make log!()
and info!()
print to stdout instead, enable the log2stdout
feature.
toml
[dependencies]
mhlog = { version = "*", features = ["log2stdout"] }
Coloured log messages can be enabled with the colours
feature.
toml
[dependencies]
mhlog = { version = "*", features = ["colours"] }
log2stdout
.coloured
feature.err
, warn
, info
, and log