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

defmt logs give the wrong filesystem path #2930

Open
Juliapixel opened this issue May 12, 2024 · 0 comments
Open

defmt logs give the wrong filesystem path #2930

Juliapixel opened this issue May 12, 2024 · 0 comments

Comments

@Juliapixel
Copy link

All of the defmt logging macro calls of the libraries in this project return the wrong path (at least when using probe-rs)

While the crate and module paths of the call sites are actually correct, the file paths and lines point instead to the declaration site of the crates' convenience macros, as can be seen in this excerpt:

0.000087 INFO  USB: config_descriptor used: 49
└─ embassy_usb::builder::{impl#1}::build @ /home/julia/.cargo/git/checkouts/embassy-9312dcb0ed774b29/15c3ae8/embassy-usb/src/fmt.rs:143 
0.000114 INFO  USB: bos_descriptor used: 12
└─ embassy_usb::builder::{impl#1}::build @ /home/julia/.cargo/git/checkouts/embassy-9312dcb0ed774b29/15c3ae8/embassy-usb/src/fmt.rs:143 
0.000141 INFO  USB: msos_descriptor used: 0
└─ embassy_usb::builder::{impl#1}::build @ /home/julia/.cargo/git/checkouts/embassy-9312dcb0ed774b29/15c3ae8/embassy-usb/src/fmt.rs:143 
0.000166 INFO  USB: control_buf size: 64
└─ embassy_usb::builder::{impl#1}::build @ /home/julia/.cargo/git/checkouts/embassy-9312dcb0ed774b29/15c3ae8/embassy-usb/src/fmt.rs:143

From experimenting with this myself, with both declarative and procedural macros, it appears that this is a limitation of using declarative macros, which is also probably(?) why the defmt crate itself uses procedural macros in all of its exports.

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