[][src]Crate mhlog

mhlog is a simple, thread-safe logging library.

extern crate mhlog;
 
use mhlog::{info,error};
 
mhlog::init(mhlog::Lvl::Info, "test", false);
info!("an info message");
error!("an error message...");

Writes log messages to stdout/stderr, and optionally to a log file. If an error occurs when writing to the log file it panics.

Macros

debug

Print a debug log message.
Prefix: [~]

error

Print an error log message.
Prefix: [!]

fatal

Print a fatal log message.
Prefix: [!!]

important

Print an important log message.
Prefix: [*]

info

Print an info log message.
Prefix: [ ]

trace

Print a trace log message.
Prefix: [.]

warning

Print a warning log message.
Prefix: [-]

Structs

LogError

Error returned by mhlog methods.

Enums

Lvl

Logging levels.

Functions

init

Initialize mhlog. It is not necessary to do initialization before calling the logging macros. Default logging level before initialization is performed is Lvl::Important.