0

My app is running continuously and I'd like to have a log folder created during runtime for each day. I would then place the logs of the day in the appropriate folder. It would look like this:

logs/
     07-11-2016/file1.log
     07-12-2016/file1.log

I didn't find a signal that could be triggered by an instance of QDate or something else when the date changes. It would seem to me to be the most convenient way.

The idea would be to have some sort of QTimer triggering a signal each time the date changes (day by day).

Grégoire Borel
  • 1,880
  • 3
  • 33
  • 55
  • Does the folder really need to be created as soon as the date changes? Why not wait until the log file is written -- at which point you can make sure a folder representing *today* exists? Sorry if I've missed the point but it's not immediately obvious why you need to create the folder immediately. – G.M. Jul 11 '16 at 17:23
  • The log file of a given day does not have a size limit. When the day changes, the log file of the previous day closes and a new one is created for the new day. I'm mainly doing this for clarity reasons. In case the app crashes, I'll be able to tell on which day it happened and easily sort the data. – Grégoire Borel Jul 12 '16 at 07:18

0 Answers0