61 releases (29 stable)

new 1.18.0 May 1, 2026
1.17.2 Feb 12, 2026
1.16.2 Jan 28, 2026
1.14.0 Dec 5, 2025
0.11.0-alpha.7 Jul 31, 2024

#23 in #tracing-metrics

Download history 166/week @ 2026-01-08 100/week @ 2026-01-15 140/week @ 2026-01-22 215/week @ 2026-01-29 204/week @ 2026-02-05 163/week @ 2026-02-12 128/week @ 2026-02-19 161/week @ 2026-02-26 162/week @ 2026-03-05 93/week @ 2026-03-12 64/week @ 2026-03-19 238/week @ 2026-03-26 107/week @ 2026-04-02 163/week @ 2026-04-09 264/week @ 2026-04-16 139/week @ 2026-04-23

740 downloads per month
Used in emit_traceparent

MIT/Apache

350KB
8K SLoC

Emit diagnostic events to the console.

This library implements a text-based format that's intended for direct end-user consumption, such as in interactive applications.

Getting started

Add emit and emit_term to your Cargo.toml:

[dependencies.emit]
version = "1.18.0"

[dependencies.emit_term]
version = "1.18.0"

Initialize emit using emit_term:

fn main() {
let rt = emit::setup()
.emit_to(emit_term::stdout())
.init();

// Your app code goes here

rt.blocking_flush(std::time::Duration::from_secs(30));
}

emit_term uses a format optimized for human legibility, not for machine processing. You may also want to emit diagnostics to another location, such as OTLP through emit_otlp or a rolling file through emit_file for processing. You can use emit::Setup::and_emit_to to combine multiple emitters:

fn main() {
let rt = emit::setup()
.emit_to(emit_term::stdout())
.and_emit_to(some_other_emitter())
.init();

// Your app code goes here

rt.blocking_flush(std::time::Duration::from_secs(30));
}

Configuration

emit_term has a fixed format, but can be configured to force or disable color output instead of detect it.

To disable colors, call Stdout::colored with the value false:

fn main() {
let rt = emit::setup()
// Disable colors
.emit_to(emit_term::stdout().colored(false))
.init();

// Your app code goes here

rt.blocking_flush(std::time::Duration::from_secs(5));
}

To force colors, call Stdout::colored with the value true:

fn main() {
let rt = emit::setup()
// Force colors
.emit_to(emit_term::stdout().colored(true))
.init();

// Your app code goes here

rt.blocking_flush(std::time::Duration::from_secs(5));
}

emit_term

term

Current docs

Emit diagnostic events to the console.

This library implements a text-based format that's intended for direct end-user consumption, such as in interactive applications.

Dependencies

~2.2–4.5MB
~93K SLoC