Add a feature for defmt support #450

Open
opened 2025-07-18 07:46:11 -05:00 by petekubiak · 3 comments
petekubiak commented 2025-07-18 07:46:11 -05:00 (Migrated from github.com)

Hi, it would be really handy to have a feature on the crate to opt into defmt support so that bitflags structs can be printed to trace with defmt. Thanks!

Hi, it would be really handy to have a feature on the crate to opt into defmt support so that bitflags structs can be printed to trace with defmt. Thanks!
KodrAus commented 2025-07-18 18:32:53 -05:00 (Migrated from github.com)

Hi @petekubiak 👋 defmt is unfortunately a bit tricky to support in libraries, but we could look at adding support in bitflags_derive for it.

Hi @petekubiak :wave: `defmt` is unfortunately a bit tricky to support in libraries, but we could look at adding support in [`bitflags_derive`](https://github.com/bitflags/bitflags-derive) for it.
petekubiak commented 2025-07-18 19:17:39 -05:00 (Migrated from github.com)

Thanks for your reply! I have an idea for how to do this, when I find a bit of time I'll test it out and raise a PR if it works.

Thanks for your reply! I have an idea for how to do this, when I find a bit of time I'll test it out and raise a PR if it works.
theol0403 commented 2025-08-05 16:21:33 -05:00 (Migrated from github.com)

Might be helpful here, I've had good luck using https://github.com/t-moe/defmt-or-log/tree/master/defmt-or-log in my libraries to have switchable log or defmt support.

Might be helpful here, I've had good luck using https://github.com/t-moe/defmt-or-log/tree/master/defmt-or-log in my libraries to have switchable log or defmt support.
Sign in to join this conversation.
No labels
bug
good first issue
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-bitflags/bitflags#450
No description provided.