Cargo Features

defmt has no features set by default.

defmt = { version = "0.3.6", features = ["ip_in_core", "encoding-raw", "encoding-rzcobs", "unstable-test"] }
alloc ip_in_core

Encoding feature flags. These should only be set by end-user crates, not by library crates.

If no encoding is selected, defmt will assume the encoding is "don't care" and will pick a default one. The current default is encoding-rzcobs. The default may change in minor releases, changing it is not considered a breaking change since all encodings are guaranteed to be supported by the corresponding defmt-decoder version.

Raw encoding: All log frames are concatenated and sent over the wire with no framing or compression. This is the fastest CPU-wise, but may end up being slower if the limiting factor is wire speed.


rzCOBS encoding: Performs framing on the log frames using reverse-COBS, additionally applying a light compression for data known to contain many zero bytes, like defmt streams.
The framing allows the decoder to recover from missing or corrupted data, and start decoding in the middle of a stream, for example when attaching to an already-running device.


WARNING: for internal use only, not covered by semver guarantees

Enables unstable-test of defmt-macros

Affects export::fetch_string_index, export::fetch_add_string_index, export::fetch_bytes, export::acquire, export::release, export::write, export::timestamp, export::panic