Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no_std support #38

Open
tommy-gilligan opened this issue Nov 25, 2023 · 0 comments
Open

no_std support #38

tommy-gilligan opened this issue Nov 25, 2023 · 0 comments

Comments

@tommy-gilligan
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant