mtlog
Multi-threaded logger with support for progress bars and log files.
Usage
// Cargo.toml
...
[]
= "0.2.0"
use logger_config;
let _guard = logger_config
.init_global;
info!;
// guard ensures logs are flushed when dropped
Multi-threaded logging
use logger_config;
let _guard = logger_config
.with_name
.init_global;
info!;
let handles: = .map.collect;
for h in handles
// guard ensures logs are flushed when dropped
Logging to files
Files can be used to log messages. The log file is created if it does not exist and appended to if it does. Threads can log to different files. If no file is specified in local config, the global file is used.
use logger_config;
let _guard = logger_config
.with_log_file
.expect
.no_stdout // disable stdout logging if needed
.init_global;
info!;
drop; // ensure logs are flushed
assert!;