Skip to content

Add external logs (loggable objects) for use with the slog ecosystem.

License

Notifications You must be signed in to change notification settings

thomaswhiteway/slog-extlog

 
 

Repository files navigation

This repository adds support for external logs, and for statistics tracking through those logs, to the slog ecosystem.

Overview

External logs are logs that form an external API that end users can rely on, and that do not change without explicit agreement.

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 StatisticsLogger type that wraps an slog::Logger, which handles logging and updating tracked stats.
  • An xlog! macro for making the logs through the StatisticsLogger.

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:

About

Add external logs (loggable objects) for use with the slog ecosystem.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%