[Development] (long) thoughts on categorized logging (qLog)
BRM
bm_witness at yahoo.com
Fri Feb 24 17:00:40 CET 2012
> From: "shane.kearns at accenture.com" <shane.kearns at accenture.com>
> To: bm_witness at yahoo.com; lincoln.ramsay at nokia.com; david.faure at kdab.com
> Cc: development at qt-project.org
> Sent: Friday, February 24, 2012 10:46 AM
> Subject: RE: [Development] (long) thoughts on categorized logging (qLog)
>> well, it probably shouldn't be in CWD regardless of platform.
> Agreed, unless you're specifying the log file via a command line parameter
>> On Windows, I'd suggest %APPDATA%\<program name> or at
> minimum
>> %APPDATA%.
>> You might even get away with using %TEMP%; but it'd be harder to find
>> the log then.
>> On other platforms, something under ${HOME} .
>
> I don't recommend using the temp path on windows, it usually contains
> hundreds of files. (and is inside appdata\local by default)
Thus my point about not being able to find stuff.
> The appdata area is organized by application, however it is a hidden folder.
> There's also the local/roaming split for appdata which isn't obvious for
> cross platform developers.
The local/roaming is also hidden by default. That shouldn't be an issue.
I do agree that it should, if possible, go under an Application name of some sort - typically Organization\Application -
but didn't suggest necessarily doing so due to a comment (Thiago?) about not wanting to use those.
> The intent of appdata seems to be data that belongs to the application rather
> than the user (e.g. settings, persistent data)
Yes; though it is for anything the application wants to keep around.
If the same file is used; then it could be reset regularly to keep space considerations from being a problem;
or even just rotate between a couple files in that location. There are things that could be done to mitigate the space issue.
> As logging is mainly for developers, using QDir::homePath() as the default
> everywhere might be ok.
Home path might not be the best as it could intermingle with other files that belong to the user.
On *nix, QDir::homePath() that would be /home/<username> and users see that directory a lot, and it will get intermixed with other files.
On Windows, most users have no clue about %userprofile%, so its not an issue there.
$0.02
Ben
More information about the Development
mailing list