-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Sort IDs of log msgs by severity to allow runtime filtering #843
Conversation
I can see what you're trying to do, but it looks like this broke the Windows builds? Also, are we sure that the IDs always fit in a u16? (Maybe this is assumed somewhere else already). |
d4c6325
to
3a0ae94
Compare
3a0ae94
to
ef2cef8
Compare
Oops. Fixed, by ignoring the new code in the tests.
Yes, I think this is currently assumed in a lot of places. (e.g. https://github.com/knurling-rs/defmt/blob/main/defmt/defmt.x.in#L33 ) |
This looks OK to me:
|
Please could you add an entry to the CHANGELOG that references this PR? |
Sure, done. I was not expecting this to get approved this fast... Are we sure the changes in the linker file do not break any of the existing tooling? I haven't checked the source code of them, I only checked that defmt-print still works so far... |
It only involves adding some additional symbols (which I don't expect to clash with anything because they start So I'm relatively relaxed about this change. |
How could one use this PR to implement runtime filtering? This PR laid the ground work for it, but it is not covered by semver yet. you would have to set Note: you'll have to undo the rzcobs encoding first in order to get the msg-id. You can probably analyze the payload before it reaches the encoder though. |
Do you mean it is not released yet, or something else?
You can disable rzcobs encoding like this: [dependencies]
defmt = { version = "0.3", features = "encoding-raw" } Read more here Lines 25 to 40 in 29f1472
|
Thanks for replying here @Urhengulas . I'm the author of this PR and I was trying to answer what people were asking regarding this PR in the matrix chat yesterday, so that I can link to my comment here. So, no question here from my side. Sorry, for not being clear about that. By "not covered by semver" I mean that since we published |
I want to be able to filter log messages at runtime by their log level. For this, the id's must be ordered by level and we need some markers to query the id ranges of the individual levels.
This PR implements a hacked-together version of what I need. AFAIK it is not a breaking change and
defmt-print
etc will continue to work. Would something like this be mergable?Our usecase:
We develop an embedded iot product where we use defmt to store the logs into the flash of the device. When we have a defective device, the customer sends it back, and we can extract the logs from the flash. Now, it would be nice, to also be able to request the logs from the device over the air, but for that we need to be able to reduce the number of logs to transmit by filtering them. We can already filter the messages by timestamp today, but not by severity. In order to filter the logs by severity we need the changes implemented by this PR. I'll probably open-source the tooling we've built around this entire use-case, as soon as it is mature enough.
Related: #793 -> Filtering by module
(Note: This PR is not related to embedded-test in any way)