[Scummvm-devel] Log file support
Michael Madsen
michael at birdiesoft.dk
Wed Nov 24 02:26:04 CET 2010
> -----Original Message-----
> From: Johannes Schickel [mailto:lordhoto at scummvm.org]
> Sent: Wednesday, November 24, 2010 1:42 AM
> To: ScummVM devel
> Cc: Max Horn
> Subject: [Scummvm-devel] Log file support
>
> 2) Name scheme.
>
> I think this is only a real big problem in case we chose either b or c
> in 1). If we rely on a single log file I would propose to just call it
> "scummvm.log".
>
> If we chose b or c a possible option would be to add the date/time to
> the log file name. If you have other suggestions please tell us about them.
>
> For b) I think we could also use a filename set of "scummvm-1.log",
> "scummvm-2.log" etc. This has the advantage that it is relatively easy
> to implement but rather confusing for the user to find out which log
> file he should look at / submit. There are different approaches to "fix"
> this, i.e. rename the log files on startup or use names with date/time
> in them (like above) and remove the oldest one.
>
> So if somebody has an opinion about this, please just raise your voice.
If using multiple log files, I'd say using date/time naming (e.g. scummvm20101124022500.log or something along those lines) is a much better option than using an ID. A single number doesn't really say much about when it happened; at best you can have an idea about the ordering.
Furthermore, if you use a big-endian ordering of the elements (a la ISO 8601), you can just do a regular sort to order them by date in order to find the oldest/newest file; if you use an ID and limited number of log files, you would have to either use some kind of natural sorting to find the lowest ID in use (because you don't reset the ID, and regular sort breaks when you add more digits), or otherwise keep track of the current ID, or you won't be able to have a correlation between the ID and the date. That also means you can't easily delete the old logs from code.
>
> 3) Placement of the log files
>
> (...)
>
> We also need to come up with a place where to store logs on Windows.
> Since I am not familiar with how programs handle that nowadays I can not
> make any proposal here. Kirben do you have any idea here? Or anyone else
> (who is using Windows on a regularly base)?
It seems to me that the best option is to use %APPDATA%\ScummVM, since we already use that folder for other things - maybe we might want to make a subfolder for the logs, but that's pretty much the only nice option we have: these logs are not really suitable for, say, the Documents folder, and the application folder itself should be considered read-only due to UAC. (However, it might be nice if we can tell ScummVM to put the logs in the program directory, though - if only for the developers, so the log files are right there when you need them.)
Michael
More information about the Scummvm-devel
mailing list