defmt

高效、延迟的嵌入式系统日志格式化。「Efficient, deferred formatting for logging on embedded systems」

Github星跟蹤圖

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.

主要指標

概覽
名稱與所有者knurling-rs/defmt
主編程語言Rust
編程語言Rust (語言數: 3)
平台
許可證Apache License 2.0
所有者活动
創建於2020-07-24 16:04:15
推送於2025-04-14 14:21:16
最后一次提交
發布數132
最新版本名稱defmt-v1.0.1 (發布於 )
第一版名稱v0.1.0-without-version-check (發布於 2020-11-25 18:21:32)
用户参与
星數1k
關注者數12
派生數101
提交數2.3k
已啟用問題?
問題數365
打開的問題數79
拉請求數539
打開的拉請求數7
關閉的拉請求數46
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?