Open pnlarsson opened 9 years ago
Sorry, but I don't actually understand, what is happening in the changes you submitted. Could you please describe, why must we use the currently opened log file last modification date and time instead of current date? The modification datetime will be anyway updated to meet the current datetime after writing the log record once :)
If you use daily and stop app in the night and start it in the morning - it didn't roll the logs.
I need this change, it's very useful. But still your commit has a problem - the last append goes to the old logfile.
I need this change, it's very useful. But still your commit has a problem - the last append goes to the old logfile. this will be work.
QDateTime now; if (m_rollOverTime.isNull()) { QFileInfo fileInfo = QFileInfo(fileName()); if (fileInfo.isFile()) { now = fileInfo.lastModified(); } } if (!now.isValid() || now > QDateTime::currentDateTime()) { now = QDateTime::currentDateTime(); }
The rolling is working if the application is not shutdown over night (for daily).
Solved by getting the modification time from file if it exists when starting the application and using it instead of now.