simple-logging

Crates.iosimple-logging
lib.rssimple-logging
version2.0.2
sourcesrc
created_at2017-07-13 11:01:53.021773
updated_at2018-12-29 09:40:47.082006
descriptionA simple logger for the log facade
homepage
repositoryhttps://github.com/Ereski/simple-logging
max_upload_size
id23215
size17,620
Carol Schulze (Ereski)

documentation

https://docs.rs/simple-logging

README

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);
Commit count: 16

cargo fmt