5 stable releases

Uses old Rust 2015

2.0.2 Dec 29, 2018
2.0.1 Dec 31, 2017
1.0.1 Jul 13, 2017

#467 in Rust patterns

Download history 1647/week @ 2024-07-19 1607/week @ 2024-07-26 1852/week @ 2024-08-02 2133/week @ 2024-08-09 2176/week @ 2024-08-16 1770/week @ 2024-08-23 2019/week @ 2024-08-30 2097/week @ 2024-09-06 2314/week @ 2024-09-13 2512/week @ 2024-09-20 3439/week @ 2024-09-27 4700/week @ 2024-10-04 6535/week @ 2024-10-11 6191/week @ 2024-10-18 7824/week @ 2024-10-25 7200/week @ 2024-11-01

28,295 downloads per month
Used in 63 crates (58 directly)

BSD-3-Clause

12KB
159 lines

Crate Documentation Linux/OS X Windows
Crate Documentation Build Status Build Status

A simple logger for the log facade. One log message is written per line. Each line also includes the time it was logged, the logging level and the ID of the thread.

Examples

Most users will simply need to call log_to_file() with the path to the log file and minimum log level:

use log::LevelFilter;

simple_logging::log_to_file("test.log", LevelFilter::Info);

Or use log_to_stderr() if simply logging to stderr:

use log::LevelFilter;

simple_logging::log_to_stderr(LevelFilter::Info);

For more control, log_to() can be used with an arbitrary sink implementing Write + Send + 'static:

use log::LevelFilter;
use std::io;

simple_logging::log_to(io::sink(), LevelFilter::Info);

Dependencies

~62–335KB