Need help with
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

253 Stars 38 Forks Other 174 Commits 3 Opened issues


Simple Logging Facility for Rust

Services available


Need anything else?

Contributors list

simplelog Build Status Coverage Status

A simple and easy-to-use logging facility for Rust's log crate

does not aim to provide a rich set of features, nor to provide the best logging solution. It aims to be a maintainable, easy to integrate facility for small to medium sized projects, that find env_logger to be somewhat lacking in features. In those cases
should provide an easy alternative.


provides a series of logging facilities, that can be easily combined.
  • SimpleLogger
    (very basic logger that logs to stderr/out, should never fail)
  • TermLogger
    (advanced terminal logger, that splits to stderr/out and has color support) (can be excluded on unsupported platforms)
  • WriteLogger
    (logs to a given struct implementing
    . e.g. a file)
  • CombinedLogger
    (can be used to form combinations of the above loggers)


#[macro_use] extern crate log;
extern crate simplelog;

use simplelog::*;

use std::fs::File;

fn main() { CombinedLogger::init( vec![ TermLogger::new(LevelFilter::Warn, Config::default(), TerminalMode::Mixed, ColorChoice::Auto), WriteLogger::new(LevelFilter::Info, Config::default(), File::create("my_rust_binary.log").unwrap()), ] ).unwrap();

error!("Bright red error");
info!("This only appears in the log file");
debug!("This level is currently not enabled for any logger");


Results in

$ cargo run --example usage
   Compiling simplelog v0.10.0 (file:///home/drakulix/Projects/simplelog)
     Running `target/debug/examples/usage`
[ERROR] Bright red error

and myrustbinary.log

11:13:03 [ERROR] usage: Bright red error
11:13:03 [ INFO] usage: This only appears in the log file

Getting Started

Just add

simplelog = "^0.10.0"
to your

ANSI color and style support

This crate can internally depend on a paris crate to provide support for ANSI color and styles. To use this feature you need to set a paris feature, like this:

simplelog = { version = "^0.11.0", features = ["paris"] }
in your

After this you can use e.g. the following call:

info!("I can write bold text or use tags to color it>");

This will automatically generates terminal control sequences for desired styles.

More formatting info: paris crate documentation



If you wish to contribute your own logger to

or advance/extend existing loggers, feel free to create a pull request. Just don't blindly assume, that your logger will be accepted. The rational about this library is, that it is simple to use. This mostly comes down to a small and easy API, but also includes things like the amount of added dependencies. If you feel unsure about your plans, feel free to create an issue to talk about your ideas.

Happy Coding!

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.