google / google/wasefire

Support a unique interface to the logger crate

Open
#477 2 comments 0 reactions 0 assignees View on GitHub
crate:logger for:maintainability for:usability good first issue needs:implementation
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.