Expand description
A highly efficient logging framework that targets resource-constrained devices, like microcontrollers.
Check out the defmt book at https://defmt.ferrous-systems.com for more information about how to use it.
§Compatibility
The defmt
wire format might change between major versions. Attempting to read a defmt stream
with an incompatible version will result in an error. This means that you have to update both
the host and target side if a breaking change in defmt is released.
Macros§
- Just like the
core::assert!
macro butdefmt
is used to log the panic message - Just like the
core::assert_eq!
macro butdefmt
is used to log the panic message - Just like the
core::assert_ne!
macro butdefmt
is used to log the panic message - Generates a bitflags structure that can be formatted with defmt.
- Logs data at debug level.
- Just like the
core::debug_assert!
macro butdefmt
is used to log the panic message - Just like the
core::debug_assert_eq!
macro butdefmt
is used to log the panic message - Just like the
core::debug_assert_ne!
macro butdefmt
is used to log the panic message - Logs data at error level.
- This is an alias for defmt’s
unwrap
macro which supports messages like std’s except. - Logs data at info level.
- Creates an interned string (
Str
) from a string literal. - Just like the
core::panic!
macro butdefmt
is used to log the panic message - Always logs data irrespective of log level.
- Defines the global timestamp provider for defmt.
- Just like the
core::todo!
macro butdefmt
is used to log the panic message - Logs data at trace level.
- Just like the
core::unimplemented!
macro butdefmt
is used to log the panic message - Just like the
core::unreachable!
macro butdefmt
is used to log the panic message - Unwraps an
Option
orResult
, panicking if it isNone
orErr
. - Logs data at warn level.
- Writes formatted data to a
Formatter
.
Structs§
- An “adapter” type to feed
Debug
values into defmt macros, which expectdefmt::Format
values. - An “adapter” type to feed
Display
values into defmt macros, which expectdefmt::Format
values. - Encode raw defmt frames for sending over the wire.
- Handle to a defmt logger.
- An interned string created via
intern!
.
Traits§
- Trait for types that can be formatted via defmt.
- Global logger acquire-release mechanism
Functions§
- Block until host has read all pending data.
Attribute Macros§
- Defines the global defmt logger.
- Overrides the panicking behavior of
defmt::panic!