-
-
Notifications
You must be signed in to change notification settings - Fork 34
Description
Maybe a bit outside of how this crate was intended to be used but I think it would be nice if it supported no_std.
thread_local is not available in no_std. One way to deal with that would be to make indentation optional.
println! and Format are also not available in no_std. A popular way of dealing with this is to use defmt, which effectively reimplements println! and Format in a way that is appropriate for no_std. The {{:depth$}} syntax is not supported by defmt. The inclusion of this format specifier would need to be optional.
Here is WIP https://github.com/tommy-gilligan/trace
I've hardcoded no_std enabled in WIP but I consider that a nonstarter for opening a PR here. The next thing to do is to incorporate some kind of condition for toggling no_std support. I think that making thread_local and the unsupported format specifier optional across the crate could be accomplished by a feature flag.
Love to know your thoughts