42 releases

0.11.0-alpha.21 Oct 21, 2024
0.11.0-alpha.17 Sep 20, 2024
0.11.0-alpha.7 Jul 31, 2024
0.10.0 Jul 4, 2016
0.1.0 Aug 8, 2015

#63 in Debugging

Download history 111/week @ 2024-07-29 2/week @ 2024-08-05 121/week @ 2024-08-12 134/week @ 2024-08-19 510/week @ 2024-08-26 12/week @ 2024-09-02 372/week @ 2024-09-09 322/week @ 2024-09-16 103/week @ 2024-09-23 150/week @ 2024-09-30 33/week @ 2024-10-07 350/week @ 2024-10-14 212/week @ 2024-10-21 31/week @ 2024-10-28 48/week @ 2024-11-04

643 downloads per month
Used in 8 crates

MIT/Apache

3MB
11K SLoC

Rust 9K SLoC // 0.2% comments JavaScript 2K SLoC // 0.0% comments

emit

all

Developer-first diagnostics for Rust applications

emit is a framework for adding diagnostics to your Rust applications with a simple, powerful data model and an expressive syntax inspired by Message Templates. emit's guiding design principle is low ceremony, low cognitive-load.

This readme covers just enough to give you an idea of what emit is. For a proper treatment, see:

Getting started

Add emit to your Cargo.toml:

[dependencies.emit]
version = "0.11.0-alpha.21"

[dependencies.emit_term]
version = "0.11.0-alpha.21"

Initialize emit in your main.rs and start peppering diagnostics throughout your application:

fn main() {
    // Configure `emit` to write events to the console
    let rt = emit::setup()
        .emit_to(emit_term::stdout())
        .init();

    // Your app code goes here
    //
    // Try uncommenting the following line as an example:
    //
    // greet("Rust");

    // Flush any remaining events before `main` returns
    rt.blocking_flush(std::time::Duration::from_secs(5));
}

#[emit::span("Greet {user}")]
fn greet(user: &str) {
    emit::info!("Hello, {user}!");
}

The output of running the above program

Dependencies