[Interest] using QTemporaryFile for post-mortem debug logfiles?

René J.V. Bertin rjvbertin at gmail.com
Mon May 22 13:39:59 CEST 2017


On Monday May 22 2017 13:21:05 Konrad Rosenbaum wrote:

> From my experience I'd recommend you go the long route and actually
> implement the date/time comparison(*). For one: problems have the bad
> habit of forcing you to restart the application multiple times, so you'll
> lose at least the first instance of the problem.

I hear you and thought of that too. There may be a middle ground which is good enough here:
create the files with a date (and possibly PID) stamp, but rename them to a predetermined fixed name after they're closed cleanly just before program exit.

That leaves around the logs of sessions that crashed, but the less interesting logs can be subject to a cheap rotation scheme without a lot of risk.

I'm curious though, why does my QTemporaryFile trick to auto-remove only empty files not work as expected?

R.



More information about the Interest mailing list