12 stable releases (5 major)
|8.0.0||Mar 8, 2022|
|7.0.0||Mar 4, 2021|
|6.0.1||Aug 26, 2020|
|5.3.0||Apr 16, 2020|
|3.2.0||Apr 25, 2018|
#331 in Procedural macros
1,845 downloads per month
Used in slog-extlog
This crate adds support for external logs, and for statistics tracking through those logs, to the
External logs are logs that form an external API that end users can rely on, and that do not change without explicit agreement. Using them allows you to treat logs as objects, rather than strings with metadata, allowing compile-time checking of logs.
This repository provides the following.
- An API for easily defining external logs.
- An API for defining statistic values to track, and to modify them based on the external logs
StatisticsLoggertype that wraps an
slog::Logger, which handles logging and updating tracked stats.
xlog!macro for making the logs through the
- An API for retrieving the current values of all stats from the
Use of this crate
In theory, an external log can be defined simply by making any type implement
ExtLoggable. In practice, external logs will be generated by auto-deriving the
ExtLoggable trait using the
slog-extlog-derive crate from this repository.
Logs can then be generated by using the
xlog! macro to make the logs using a
StatisticsLogger - a wrapper around
slog::Logger which can also track stats.
For more details, see: