Crates.io | slog-extlog-derive |
lib.rs | slog-extlog-derive |
version | 8.1.0 |
source | src |
created_at | 2018-04-20 11:01:31.499578 |
updated_at | 2023-10-06 15:59:37.137347 |
description | Custom derive code for slog-extlog |
homepage | https://github.com/slog-rs/extlog |
repository | https://github.com/slog-rs/extlog |
max_upload_size | |
id | 61556 |
size | 43,837 |
This crate adds support for external logs, and for statistics tracking through those logs, to the slog
ecosystem.
This crate was written by Metaswitch Networks (@Metaswitch) and made freely available under the Apache 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 allows you to treat logs as objects, rather than strings with metadata, allowing compile-time checking of logs.
This repository provides the following.
StatisticsLogger
type that wraps an slog::Logger
, which handles logging and updating tracked stats.xlog!
macro for making the logs through the StatisticsLogger
.StatisticsLogger
.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: