-
Notifications
You must be signed in to change notification settings - Fork 7.5k
logging: Proposals to optimize/minimize logged content #10770
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
Comments
Calling to @carlescufi, @jukkar, @jhedberg, @nashif, and any other interested parties. Btw, I would easily understand if somebody doesn't like my "improvements". In this case, I'd just humbly call to get back to the older logging format as familiar and well-know ;-). (Well, "XML in the logging output" what concerns me foremost, those |
I am ok with current format, the color coding makes easy to spot errors anyway. One can save the log to file and then search errors, warnings etc anyway if needed. By reading the code, it is actually to my eyes easier to spot things if there are more of these [] or <> there. In your example like The extra () in function name in your example is probably because of commit 6973c6a, so if CONFIG_LOG_FUNCTION_NAME=y, then the function name is added by logging subsystem, otherwise the thing found in net_core.h is used. In this case I added () as there were people asking for that (this can be removed of course and I personally find those () quite useless). The CONFIG_LOG_FUNCTION_NAME will be introduced by #10708 which does not seem to add the () to function name. |
Everybody will be biased regarding log output format as we get used to what we use (or we have bad xml memories) so we should find existing format that is accepted by majority or agree on something that is accepted by majority. I don't have strong opinions and 'compressed' proposal looks ok (except that there is a
|
Well, based on 3 opinions posted here, that's definitely true ;-).
I don't like that, because unlike for @jukkar, for me all those
Not sure about that either, doesn't give helpful mental model for the C code. Actually, that's another topic for a potential ticket: it's a useful feature assign arbitrary logger name (as seen in the output), but how does it happen that by default everywhere in Zephyr we don't use source file name as that (with extension stripped)? That already caused me 20secs of confusion. The only reason I didn't submit it yet is because I'm not exactly sure how it was in the old logger. |
Hi @nordic-krch, This issue, marked as an Enhancement, was opened a while ago and did not get any traction. Please confirm the issue is correctly assigned and re-assign it otherwise. Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason. @pfalcon you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you. Thanks! |
So, this was initially intended to be in the vein of #10644 and #10769, i.e. user'esque complaining of random, seemingly ungrounded changes.
Let's however accept that changes can be for good, and try to consider how to take a chance of switching from old to new logging to actually improve logging output, not just change it. Of course, for that we need to define criteria of what would be improvement:
Ok, so let's look at the example of old log line (taken from #8187 (comment)):
And new line:
So, what we can see here?
()
at the end of function name in logging. No idea why they suddenly were added now. Yes, with them it's self-describing, and without them, the user would need to learn what that field means - but once (rather easy to remember hopefully). Again, could have -2 chars.So, we could easily save 6 chars per entry-line. I understand those are probably not stored in logging buffer, but sanding them thru UART/whatever still takes extra time, still may wrap line for user which wouldn't be wrapped otherwise.
Examples of lines above with the propose changes:
The text was updated successfully, but these errors were encountered: