[−][src]Crate mhlog
A tiny, simple, thread-safe logging library. No configuration options, take it or leave it.
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!()
Usage
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 '<timestamp> Info:' "); warn!("Warning message prefixed by '<timestamp> Warning:' "); err!("Error message prefixed by '<timestamp> Error:' ");
Macros
err | Print an error log message, prefixed by a timestamp and Error. |
info | Print an info log message, prefixed by a timestamp and Info. |
log | Print a log message, prefixed by a timestamp. |
warn | Print a warning log message, prefixed by a timestamp and Warning. |