Subscribe Free

Join 2670+ others. No spamming.
I promise!

We are currently under high development. Follow us at github.


Looking for Python Tutorials?
Check these awesome tutorials



slog-rs/slog

223

slog-rs / slog

Rust

Structured, composable logging for Rust


READ ME

slog-rs logo
Travis CI Build Status slog-rs on crates.io slog-rs Gitter Chat docs-rs: release versions documentation
Getting started Introduction FAQ
Crate list

slog-rs - The Logging for Rust

Table of Contents

Introduction

slog is an ecosystem of reusable components for structured, extensible, composable logging for Rust.

The ambition is to be The Logging Framework for Rust. slog should accommodate variety of logging features and requirements.

Status & news

slog v1 (versions 1.x.y) is a current stable release.

slog v2 (versions 2.x.y) is a work in progress. API of slog v2 is very similar to slog v1 and most changes are under the hood. Porting should be relatively easy. See changes in slog v2 for details.

I encourage you to try slog v2 and give feedback. See slog v2 status page.

Features & technical documentation

Most of interesting documentation is using rustdoc itself.

You can view on docs.rs/slog for v1 or docs.rs/slog for v2.

Terminal output example

slog-term is only one of many slog features - useful showcase.

Automatic TTY detection and colors:

slog-rs terminal full-format output

Compact vs full mode:

slog-rs terminal compact output slog-rs terminal full output

Using & help

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 your project

In Cargo.toml:

[dependencies]
slog = "1.2"

In your main.rs:

#[macro_use]
extern crate slog;

Compatibility Policy

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:

[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.

Minimum Version 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 community

Overview

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!

slog-related articles