slog-rs - Structured, composable logging for Rust
Code snippet
See examples/features.rs
for full code.
Introduction
Structured, composable logging for Rust. Work in progress, but usable already.
Heavily inspired by log15 for Go, which I liked so much, that I want it in Rust too.
Read Documentation for details and features.
If you want to say hi, or need help use #dpc gitter.im.
To report a bug or ask for features use github issues.
Features
- easy to use
- hierarchal loggers
- lazily evaluated values
- extensible: first-class custom implementations
- drains & output formatting
- filtering
- multiple outputs
- asynchronous IO writing
- terminal output, with color support (
slog-term
crate) - Json (
slog-json
crate)- Bunyan (
slog-bunyan
crate)
- Bunyan (
- more to come (syslog, network)
Building & running
If you need to install Rust (come on, you should have done that long time ago!), use rustup.
In your project
In Cargo.toml:
[dependencies]
slog = "*"
In your main.rs
:
#[macro_use]
extern crate slog;