Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kodraus/emit
Structured logging for Rust
https://github.com/kodraus/emit
Last synced: about 2 months ago
JSON representation
Structured logging for Rust
- Host: GitHub
- URL: https://github.com/kodraus/emit
- Owner: KodrAus
- License: apache-2.0
- Created: 2019-06-28T00:45:14.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T22:01:52.000Z (9 months ago)
- Last Synced: 2024-04-13T18:07:56.326Z (9 months ago)
- Language: Rust
- Homepage:
- Size: 955 KB
- Stars: 27
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
> **Archived:** This project has been moved back into https://github.com/emit-rs/emit.
emit[![all](https://github.com/KodrAus/emit/actions/workflows/all.yml/badge.svg)](https://github.com/KodrAus/emit/actions/workflows/all.yml)
[Current docs](https://docs.rs/emit/0.11.0-alpha.2/emit/index.html)
## Structured diagnostics for Rust applications.
`emit` is a structured logging framework for manually instrumenting Rust applications with an expressive syntax inspired by [Message Templates](https://messagetemplates.org).
`emit` represents all diagnostics as _events_; a combination of timestamp or timespan, template, and properties. Traditional log records, spans in a distributed trace, and metric samples are all represented as events. Having a unified model of all these signals means you can always capture your diagnostics in one way or another.
```toml
[dependencies.emit]
version = "0.11.0-alpha.2"[dependencies.emit_term]
version = "0.11.0-alpha.2"
``````rust
use std::time::Duration;fn main() {
let rt = emit::setup()
.emit_to(emit_term::stdout())
.init();greet("Rust");
rt.blocking_flush(Duration::from_secs(5));
}#[emit::span("Greet {user}")]
fn greet(user: &str) {
emit::info!("Hello, {user}!");
}
```![The output of running the above program](https://github.com/KodrAus/emit/blob/main/asset/emit_term.png?raw=true)
## Current status
This is alpha-level software. It implements a complete framework but has almost no tests and needs a lot more documentation.
## Getting started
See the `examples` directory and `emit` documentation for how to get started with `emit`.