9 releases

Uses new Rust 2021

0.3.1 Nov 26, 2021
0.3.0 Nov 10, 2021
0.2.2 Jun 17, 2021
0.2.1 May 21, 2021
0.1.4 Nov 26, 2020

#23 in Embedded development

Download history 460/week @ 2021-09-26 256/week @ 2021-10-03 420/week @ 2021-10-10 401/week @ 2021-10-17 608/week @ 2021-10-24 475/week @ 2021-10-31 630/week @ 2021-11-07 598/week @ 2021-11-14 745/week @ 2021-11-21 752/week @ 2021-11-28 423/week @ 2021-12-05 411/week @ 2021-12-12 354/week @ 2021-12-19 350/week @ 2021-12-26 813/week @ 2022-01-02 653/week @ 2022-01-09

2,195 downloads per month
Used in less than 6 crates

MIT/Apache

140KB
3.5K SLoC

defmt

defmt ("de format", short for "deferred formatting") is a highly efficient logging framework that targets resource-constrained devices, like microcontrollers.

For more details about the framework check the book at https://defmt.ferrous-systems.com.

The git version of the defmt book can be viewed at https://defmt-next.ferrous-systems.com/.

Setup

New project

The fastest way to get started with defmt is to use our app-template to set up a new Cortex-M embedded project.

Existing project

To include defmt in your existing project, follow our Application Setup guide.

MSRV

defmt always compiles on the latest stable rust release. This is enforced by our CI building and testing against this version.

It still might work on older rust versions, but this isn't ensured.

defmt ecosystem

The following diagram illustrates the user-facing and internal crates of the defmt framework.

defmt crates structure

Developer Information

Running Tests

Tests are run using cargo xtask -- although this is simply an alias (defined in .cargo/config.toml) for cargo run --package xtask --.

To see a list of options, see xtask/src/main.rs, or run:

$ cargo xtask help

For example, to run all the tests, run:

$ cargo xtask test-all

You will need qemu-system-arm installed and in your $PATH for some of the tests (e.g. test-snapshot).

Support

defmt is part of the Knurling project, Ferrous Systems' effort at improving tooling used to develop for embedded systems.

If you think that our work is useful, consider sponsoring it via GitHub Sponsors.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

Dependencies

~6MB
~116K SLoC