-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add logging #331
Open
psyomn
wants to merge
19
commits into
powertab:master
Choose a base branch
from
psyomn:feature/add-logging
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add logging #331
Commits on Jan 5, 2024
-
Partially inspired by rfc5424, along with a few other idioms I picked up along the way. This should allow one to tweak the log level by setting a minimum log level in the `Log' namespace. Right now I've set the log level to debug in the main entry point.
Configuration menu - View commit details
-
Copy full SHA for ff34267 - Browse repository at this point
Copy the full SHA ff34267View commit details
Commits on Jan 7, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d7d9ba2 - Browse repository at this point
Copy the full SHA d7d9ba2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 933c675 - Browse repository at this point
Copy the full SHA 933c675View commit details -
Configuration menu - View commit details
-
Copy full SHA for e436cb5 - Browse repository at this point
Copy the full SHA e436cb5View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd117d8 - Browse repository at this point
Copy the full SHA bd117d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a33e41 - Browse repository at this point
Copy the full SHA 5a33e41View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab56bc3 - Browse repository at this point
Copy the full SHA ab56bc3View commit details -
Show logs in infodialog's edit box
Users should be able to copy the logs from the infodialog box, along with version information for slightly easier troubleshooting.
Configuration menu - View commit details
-
Copy full SHA for 26cf888 - Browse repository at this point
Copy the full SHA 26cf888View commit details -
Configuration menu - View commit details
-
Copy full SHA for 34f0088 - Browse repository at this point
Copy the full SHA 34f0088View commit details -
Configuration menu - View commit details
-
Copy full SHA for e72a569 - Browse repository at this point
Copy the full SHA e72a569View commit details -
Configuration menu - View commit details
-
Copy full SHA for 64307ad - Browse repository at this point
Copy the full SHA 64307adView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ce38cb - Browse repository at this point
Copy the full SHA 3ce38cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2ca68d1 - Browse repository at this point
Copy the full SHA 2ca68d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ba2a3d - Browse repository at this point
Copy the full SHA 5ba2a3dView commit details -
Replace use of std::format with fmt:format in logger
I'm leaving this commit here instead of squashing, so that in the future, we could technically just reverse this commit.
Configuration menu - View commit details
-
Copy full SHA for f5da24a - Browse repository at this point
Copy the full SHA f5da24aView commit details -
Implement poorman's log rotating
This implements a very simple circular buffer that will take the last N lines in a log file, and keep those instead. Right now the maximum N is hardcoded, but the code is written in a fashion that we can revisit some of this, and add toggles where we see fit (for example in a settings dialog or so). I tested out the functionality this way: $ yes some-log-line | nl | head -5000 > log.txt And then running PTE2 with a max log size of 1000, I noticed the logfile like so: $ head -10 log.txt 4001 some-log-line 4002 some-log-line 4003 some-log-line 4004 some-log-line 4005 some-log-line 4006 some-log-line 4007 some-log-line 4008 some-log-line 4009 some-log-line 4010 some-log-line and the bottom: $ tail -10 log.txt 2023-12-30T14:38:32Z: [debug]: finding translations for locale: 2023-12-30T14:38:32Z: [debug]: locale: en-US 2023-12-30T14:38:32Z: [debug]: locale: en 2023-12-30T14:38:32Z: [debug]: locale: en-Latn-US 2023-12-30T14:38:32Z: [debug]: - checking: /home/psyomn/.local/share/powertab/powertabeditor/translations 2023-12-30T14:38:32Z: [debug]: - checking: /usr/local/share/powertab/powertabeditor/translations 2023-12-30T14:38:32Z: [debug]: - checking: /usr/share/powertab/powertabeditor/translations 2023-12-30T14:38:32Z: [debug]: - checking: /home/psyomn/programming/cc/fork/powertabeditor/build/bin/data/translations 2023-12-30T14:38:32Z: [debug]: - checking: /usr/share/qt/translations 2023-12-30T14:38:32Z: [debug]: loaded qt base translations from /usr/share/qt/translations/qtbase_en.qm and last checks: $ nl log.txt | head -1 1 4001 some-log-line $ nl log.txt | tail -1 1011 2023-12-30T14:38:32Z: [debug]: loaded qt base translations from /usr/share/qt/translations/qtbase_en.qm
Configuration menu - View commit details
-
Copy full SHA for b69149b - Browse repository at this point
Copy the full SHA b69149bView commit details -
Add format wrapper for QString
This adds a custom format wrapper for QString objects, so that they can be logged directly.
Configuration menu - View commit details
-
Copy full SHA for aabde63 - Browse repository at this point
Copy the full SHA aabde63View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5bb4293 - Browse repository at this point
Copy the full SHA 5bb4293View commit details -
Configuration menu - View commit details
-
Copy full SHA for e11f0b4 - Browse repository at this point
Copy the full SHA e11f0b4View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.