Code review comment for lp:~mandel/ubuntu-download-manager/use-log-dir

Revision history for this message
Mike McCracken (mikemc) wrote :

this still names the file UNKNOWN.INFO

I looked into the glog source to see why - InitGoogleLogging() expects to be sent argv[0], which will always be around, so it just stores a pointer to it - it doesn't copy the string or take ownership or anything.

So I'm guessing that the QString you get from applicationName goes out of scope or something, before the filename is generated, and when it checks for the app name, it sees null and just goes with UNKNOWN. (see
https://code.google.com/p/google-glog/source/browse/trunk/src/utilities.cc#162 )

so maybe you need to hand it a heap allocated char array?

PS, I tried messing with it a bit to try to use -log-dir, and I couldn't get that to work, but I wasn't sure I was runnign it correctly. I just ran build/ubuntu-download-manager/ubuntu-download-manager -log-dir=/tmp/foo but it still used the default.

review: Needs Fixing

« Back to merge proposal