9 stable releases (3 major)
| 4.0.1 | May 4, 2023 |
|---|---|
| 4.0.0 | Sep 26, 2022 |
| 3.0.0 | Jan 21, 2022 |
| 2.0.1 | Oct 19, 2021 |
| 1.1.0 |
|
#666 in Debugging
69 downloads per month
20KB
507 lines
Configuration
Output, color, and timezone can be configured on the Logger.
Features
detect-color- Automatically detect terminal color support.detect-timezone- Iftimestampsare enabled, the local timezone will automatically be detected and used.log- Enable [log] support.parking_lot- Useparking_lotinternally.timestamps- Enable timestamps.tracing- Enabletracingsupport.
Log level
Set the level using log or tracing directly.
Filtering
To add filtering with [log], create a new struct that implements Log::enabled, and forward
the other methods to tinylog::Logger.
For tracing, tracing_subscriber already lets you add filters to existing layers.
tinylog
A logger for my personal projects. Major version increases may occur at any time.
Goals
- Fast
- Write to a thread-local string before writing it to output. This way, all logic can occur before the lock, saving time in multi-threaded scenarios.
- Avoid
dynwhen possible. - Avoid
std::fmt::Formatter. It usesdynand every write produces aResult.
- Minimal
- Only provide configuration when it would be difficult to produce the same behavior without it.
- The default configuration should work for most scenarios.
- Avoid dependency bloat. Make them optional if possible, and disable their default features.
- Pretty
- Use colors.
- Print things in a human-friendly format.
Dependencies
~0–2.5MB
~45K SLoC