emtrace 0.2.0

Minimal overhead tracing/logging library for embedded, and resource constrained projects.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use emtrace::{CobsConsumer, expect, init, magic, traceln};

fn main() {
    expect!("Hello from COBS Rust!\n2 + 3 = 5\n");
    // COBS-encoded pipeline: `magic!` wraps a `CobsConsumer` around stdout, and the
    // magic record advertises `EMT_ENCODING_COBS`. The initialization frame must be
    // COBS-encoded as well, so hand `init` the same kind of sink.
    magic!(.cobs);

    let mut sink = CobsConsumer::new(std::io::stdout().lock());
    init(&mut sink).unwrap();
    drop(sink);

    traceln!("Hello from COBS Rust!");
    traceln!("{} + {} = {}", i32: 2, i32: 3, i32: 5);
}