Getting started
Introduction
FAQ
Crate list
slog
is an ecosystem of reusable components for structured, composable logging
for Rust.
The ambition is to be The Logging Framework for Rust. slog
should accommodate
variety of logging features and requirements.
slog
crate#![no_std]
support (with opt-out std
cargo feature flag)log
crate (slog-stdlog
crate)
crates/example-lib
log
crate)slog-envlogger
- port of env_logger
slog-term
crate)slog-json
crate)
slog-bunyan
crate)slog-syslog
crate)log
crateslog
provides core functionality, and some standard
feature-set. But using traits, anyone can easily implement as
powerful fully-custom features, publish separately and grow slog
feature-set
for everyone.env_logger
, but output authentication messages to syslog,
while reporting errors over network in json format? With slog
drains can
reuse other drains! You can combine them together, chain, wrap - you name it.log
you would have to repeat this information in
every log statement. In slog
it will happen automatically. See
slog-rs functional overview page to understand better
logger and drain hierarchies and log record flow through them.Async
drain, and closures
to make your logging fast.AtomicSwitch
drain allows
changing logging behavior in the running program. You could use eg. signal
handlers to change logging level or logging destinations. See
signal
example.slog-term
is only one of many slog
features - useful showcase.
Automatic TTY detection and colors:
Compact vs full mode:
See examples/features.rs for full quick code example overview.
See [faq] for answers to common questions and [wiki] for other documentation articles. If you want to say hi, or need help use [slog-rs gitter] channel.
Read Documentation for details and features.
To report a bug or ask for features use github issues.
In Cargo.toml:
[dependencies]
slog = "1.2"
In your main.rs
:
```
extern crate slog; ```
slog
follows SemVer: this is the official policy regarding breaking changes
and minimum required versions of Rust.
Slog crates should pin minimum required version of Rust to the CI builds. Bumping the minimum version of Rust is considered a minor breaking change, meaning at a minimum the minor version will be bumped.
In order to keep from being surprised of breaking changes, it is highly
recommended to use the ~major.minor.patch
style in your Cargo.toml
if you
wish to target a version of Rust that is older than current stable minus two
releases:
toml
[dependencies]
slog = "~1.3.0"
This will cause only the patch version to be updated upon a cargo update
call, and therefore cannot break due to new features, or bumped minimum
versions of Rust.
slog
and it's ecosystem officially supports current stable Rust, minus
two releases, but may work with prior releases as well. For example, current
stable Rust at the time of this writing is 1.13.0, meaning slog
is guaranteed
to compile with 1.11.0 and beyond. At the 1.14.0 release, slog
will be
guaranteed to compile with 1.12.0 and beyond, etc.
Upon bumping the minimum version of Rust (assuming it's within the stable-2
range), it must be clearly annotated in the CHANGELOG.md
Slog related crates are hosted under slog github organization.
Dawid Ciężarkiewicz is the original author and current maintainer of slog
and
therefore self-appointed benevolent dictator over the project. When working on
slog Dawid follows and expects everyone to follow his Code of
Conduct.
Any particular repositories under slog ecosystem might be created, controlled, maintained by other entities with various level of autonomy. Lets work together toward a common goal in respectful and welcoming atmosphere!