-
-
Notifications
You must be signed in to change notification settings - Fork 86
Description
Specifically, defmt helps with formatting values in embedded scenarios where core::fmt doesn't work as well. My understanding of the underlying value proposition is that it provides "deferred" formatting. That it, there is some wire protocol where an efficient representation of values is transferred to the host machine and it's the host machine that does the actual formatting.
This was brought up in #168:
I spent a couple of hours working on this today. At this point, defmt works with all public-facing structs and enums in jiff. However, it does not currently work when either the
stdfeature or theallocfeature is enabled. (This is becausedefmtonly implements on Format trait onalloc::core::Box<T>whereTisSized)There is some value in making
defmtcompatible with alloc, but the lack of support should not be a blocker for now as most embedded devices do not have an allocator.One important caveat: Supporting defmt comes with the trade-off that, if you ever want to take on a third-party dependancy for jiff, you will need to the upstream dependency to support defmt, or will need to create wrapper structs. I do see that you depend on very few third party dependencies, so this may not be an issue.
I’m still verifying that we don’t rely on
core::fmtanywhere. The entire value proposition ofdefmtis to reduce compile-time code size and defer formatting until logs are rendered on a debugger. If any part of the code still usescore::fmtat runtime, that benefit is lost, and we are wasting out time.
btw, thanks for getting back to me so quickly, I cannot say how refreshing that is.
Thank you so much for this library!
Originally posted by @dickermoshe in #168