#simple #log #logger #logging

simple-logging

A simple logger for the log facade

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

#317 in Rust patterns

Download history 1149/week @ 2021-04-11 1176/week @ 2021-04-18 1362/week @ 2021-04-25 1095/week @ 2021-05-02 1050/week @ 2021-05-09 1323/week @ 2021-05-16 1520/week @ 2021-05-23 1844/week @ 2021-05-30 1409/week @ 2021-06-06 1481/week @ 2021-06-13 1424/week @ 2021-06-20 1687/week @ 2021-06-27 804/week @ 2021-07-04 1548/week @ 2021-07-11 1552/week @ 2021-07-18 1715/week @ 2021-07-25

4,986 downloads per month
Used in less than 22 crates

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

~145KB