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

#565 in Rust patterns

Download history 1793/week @ 2024-01-19 1417/week @ 2024-01-26 1132/week @ 2024-02-02 1573/week @ 2024-02-09 1241/week @ 2024-02-16 1217/week @ 2024-02-23 1895/week @ 2024-03-01 2083/week @ 2024-03-08 2492/week @ 2024-03-15 2136/week @ 2024-03-22 2011/week @ 2024-03-29 1771/week @ 2024-04-05 1655/week @ 2024-04-12 2059/week @ 2024-04-19 1888/week @ 2024-04-26 1945/week @ 2024-05-03

7,822 downloads per month
Used in 53 crates (49 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

~66–340KB