Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Structured, contextual, extensible, composable logging for Rust

License

Apache-2.0 and 2 other licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
MPL-2.0
LICENSE-MPL2
NotificationsYou must be signed in to change notification settings

slog-rs/slog

slog-rs logo
GH Actions (Cargo Test)slog-rs on crates.ioslog-rs Gitter Chatdocs-rs: release versions documentation
Getting startedIntroductionFAQ
Crate list

slog-rs - The Logging forRust

You might consider usingtracing instead

It's been a while sinceslog was created and it servedRust community well all this time. It remains a stable, featurefuland battle-tested library, used in many important projects.

In last few years,another ecosystem for Rust wascreated with similar features and a very good support for debuggingasync codeand already larger dev team and community.

Please checktracing and seeif it is more suitable for your use-case. It seems that it is alreadya go-to logging/tracing solution for Rust.

Reasons you might want to stick withslog anyway:

  • async support doesn't benefit you
  • you consider mature, stable code & API a plus
  • it has some features thattracing is missing
  • great performance (I have NOT done any comparison, butslog's performanceis very good).

Introduction (please read)

slog is an ecosystem of reusable components for structured, extensible,composable and contextual logging forRust.

The ambition is to be The Logging Library for Rust.slog should accommodate avariety of logging features and requirements. If there is a feature that youneed and standardlog crate is missing,slog should have it.

This power comes with a little steeper learning curve, so if you experience anyproblems,please joinslog-rs gitter channel to get up to speed. If you'dlike to take a quick, convenient route, consider usingsloggers wrapper library.

While the code is reliable, the documentation sometimes could use an improvement.Please report all issues and ideas.

Features & technical documentation

Most of the interesting documentation is auto-generated and hosted onhttps://docs.rs.

Go todocs.rs/slog to read about features and APIs(examples included).

Note:slog is just a core, and the actual functionality is insidemany feature crates. To name a few:

There are many more slog feature crates. Search formore slog features oncrates.io. It is easy to write and publishnew ones. Look through all theexisting crates usingslog for examples and ideas.

Terminal output example

slog-term is only one of manyslog features - useful showcase,multi-platform, and featuring eg. automatic TTY detection and colors.

See following screenshot: same output in both compact and full output mode.

slog-rs terminal example output

Using & help

Please useslog-rs gitter channel to ask for help or discussslog features.

Seeexamples/features.rsfor full quick code example overview.

ReadDocumentation for details and features.

To report a bug or ask for features usegithub issues.

Slog community

Slog related crates are hosted underslog githuborganization.

Dawid Ciężarkiewicz is the original author and current maintainer ofslog andtherefore self-appointed benevolent dictator over the project. When working onslog Dawid follows and expects everyone to follow hisCode ofConduct.

Any particular repositories under slog ecosystem might be created, controlled,maintained by other entities with various levels of autonomy. Lets work togethertoward a common goal in a respectful and welcoming atmosphere!

Verification Recommendation

To help with the maintained, the ownership of this crate is potentially shared between multiple developers.It is recommended to always usecargo-crevto verify the trustworthiness of each of your dependencies, including this one.


[8]ページ先頭

©2009-2025 Movatter.jp