-
Notifications
You must be signed in to change notification settings - Fork 37.9k
log: Don't use scientific notation in log messages #29254
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
I don't think nanosecond precision helps here. Might as well limit to Same here?
|
Agree, such precision is not needed, but didn't seem too important, message itself is relatively small anyway, so few extra characters doesn't hurt. I would prefer millisecond precision, but plain
Will look at it. |
Why? "It took less than 1ms" should be pretty intuitive. |
Tested ACK. Before: With %f: With %0.3f:
A ceiling function wouldn't be right either, since it would report 1ms for my test when it actually took 2 µs. Rounding to the nearest 1ms would be nice (1.99 ms would be logged as 2ms not 1ms), but might not be worth the added code complexity for little benefit. |
Are you still working on this, or should it be marked "up for grabs"? |
@kristapsk if you prefer, I'd be happy to see it through. |
e9f98cc
to
c819a83
Compare
Changed also other message and added rouding to ms precision. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm ACK c819a83. can you update the PR description?
Updated. |
lgtm |
Are you sure the 'before" is accurate? |
Yes, |
Oh, wait, no, accidentally removed precision for "before" when editing, double checked debug.log, fixed. |
Don't see any benefits here, only harder to read for most of the users.
Before:
After: