- Notifications
You must be signed in to change notification settings - Fork12
Add external logs (loggable objects) for use with the slog ecosystem.
License
slog-rs/extlog
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This crate adds support forexternal logs, and for statistics tracking through those logs, to theslog ecosystem.
This crate was written by Metaswitch Networks (@Metaswitch) and made freely available under theApache License.Contributions are welcome.
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 allowsyou 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
- A
StatisticsLoggertype that wraps anslog::Logger, which handles logging and updating tracked stats. - An
xlog!macro for making the logs through theStatisticsLogger. - An API for retrieving the current values of all stats from the
StatisticsLogger.
In theory, an external log can be defined simply by making any type implementExtLoggable. In practice, external logs will be generated by auto-deriving theExtLoggable trait using theslog-extlog-derive crate from this repository.
Logs can then be generated by using thexlog! macro to make the logs using aStatisticsLogger - a wrapper aroundslog::Logger which can also track stats.
For more details, see:
- the Rustdocumentation
- thebasic tests for logging examples
- thestats tests for examples with metrics and statistics tracking.
About
Add external logs (loggable objects) for use with the slog ecosystem.
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors10
Uh oh!
There was an error while loading.Please reload this page.