Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information