9 releases

0.3.4 Feb 7, 2024
0.3.3 May 5, 2023
0.3.2 Mar 29, 2023
0.3.1 Mar 10, 2022
0.1.0 Nov 11, 2020

#707 in Embedded development

Download history 25623/week @ 2024-07-21 25441/week @ 2024-07-28 27411/week @ 2024-08-04 31137/week @ 2024-08-11 30260/week @ 2024-08-18 37084/week @ 2024-08-25 36002/week @ 2024-09-01 30810/week @ 2024-09-08 30588/week @ 2024-09-15 35718/week @ 2024-09-22 28371/week @ 2024-09-29 28791/week @ 2024-10-06 34145/week @ 2024-10-13 36471/week @ 2024-10-20 39756/week @ 2024-10-27 38026/week @ 2024-11-03

151,046 downloads per month
Used in 513 crates (4 directly)

MIT/Apache

32KB
655 lines

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

~260–720KB
~17K SLoC