Support a unique interface to the logger crate
- Dominant language
- Rust
- Stars
- 188
- Forks
- 41
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 12
Description
Currently the format for `defmt` and `log` and different. It would be much more convenient to have a unique syntax for a common (and restricted) subset of those, typically to print common types like integers, strings, and bytes.
The idea would be to change the logger crate to be a proc-macro crate, and do the format conversion logic at compile-time. The goal is that such logic: https://github.com/google/wasefire/blob/ac32ec709398c325c0d0293e84f85345123e3041/crates/protocol-usb/src/device.rs#L91-L94
would be a single line:
```rust
Some(result) => log::debug!("Reading {:02x?}", result),
```
See https://github.com/knurling-rs/defmt/issues/149 for a similar issue in the `defmt` repository.
Once fixed, we should re-enable the `clippy.uninlined_format_args` lint.
Contributor guide
Assessment
This issue has not been assessed yet.