-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Logging: Include timestamps in messages by default #11861
Conversation
I think when I remember correct, the timestamp is not included intentionally. I have no strong opinion here, but I cannot remember a single case when reading users mixxx.log where I wished it has a timestamp. On the other hand I can remember discussion about complains of the file size and the default log level. It has been proposed to not write debug entries into the file. Can you describe your use case where timestamps are helpful? Maybe we can target it differently. I can also confirm that adding timestamps conditionally via QT_MESSAGE_FORMAT is too complicated. |
Why would that be the case? As long as the format passed is valid, it could be altered on every call as far as I understand. |
Just my 2 cents: |
This should cover your usecase/workflow, right?
|
Including the timestamps is quite helpful in understanding the flow of the program, without them I wouldn't know if something happened in quick succession or hours apart. This can be surprisingly useful for debugging (which I make heavy use of as I'm currently debugging a pretty hard-to-reproduce freeze...) Also while I agree that the log size shouldn't be dismissed, e.g. the size of analyzed waveforms generally dwarfs even the biggest log files which I've seen. (Most of those files are a few MB at maximum, the only one that's a few hundreds of MB large was one that included very heavy trace logging, i.e. hundreds of lines per second for several hours).
As @Swiftb0y said, this can be customized with
Perhaps I don't quite understand what you mean, I was referring to that this cannot be customized at runtime (as opposed to the stdout format). |
Can someone point me to info about |
Ah, my mistake, it was Lines 66 to 74 in dfde28d
|
Why couldn't it be customized at runtime? I mean not by Qt, but the string is built from runtime, so instead of hardcoding |
This seems to be an intentional decision (to make bug reports more uniform, I would assume): Lines 118 to 119 in dfde28d
|
Ah right. Let me clarify: I thought you said that it was technically impossible because of Qt API restrictions (or similar). Whether we should make that modifiable is a different question. I agree with the current code that we should hardcode it to keep it consistent. |
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, but I won't merge until the current discussions with the other team members have been explicitly resolved.
I can also confirm the line width issue. How about not making this a default, but making it easy to enable. What could be the alternative? A command line switch? A preferences option? |
Wdyt about only including timestamps in the |
That works for me. |
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 otherwise. Would you do me the favor and squash everything into a single commit?
As per the discussion. Note that the stdout format can still be customized dynamically via the `QT_MESSAGE_PATTERN` environment variable. Co-authored-by: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com>
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. Waiting for CI. Any1 else wanting to sign off?
This is a small patch that updates the log file format to include
hh:mm:ss.zzz
timestamps.Timestamps are particularly valuable for understanding timing-related issues and the program's execution in general, and the latter would get them included in user-submitted reports. The only drawback I see is that this would result in slightly larger log files.