GNOME Bugzilla – Bug 644270
Uncaught exception crashes Banshee if the log cannot be opened
Last modified: 2012-03-11 13:16:27 UTC
Created attachment 182913 [details] [review] Patch to suppress exceptions when opening the log file There are a number of reasons why the log file couldn't be opened, including file attributes, permissions, locking, etc. While these are generally indicative of some other problem, it is probably best to let that problem surface in some other way. I've attached a patch to suppress any exception raised when trying to open a log file or redirect the console output. (Incidentally, I changed the name of the log file to `banshee.log` to make it easier to open from Windows Explorer)
Created attachment 182914 [details] [review] Patch to send non-redirected messages to StdErr I also think it is wise to send messages that shouldn't be redirected to StdErr instead of StdOut, since in the latter case, there is no way to get them. In the former case, the user can manually redirect the stream to a file ala:: Nereid.exe 2> banshee.err
Comment on attachment 182914 [details] [review] Patch to send non-redirected messages to StdErr This patch doesn't include the change to 'banshee.log'. I'm not fond of printing "Logging to {0}" to STDERR, since it's not an error.
(In reply to comment #2) > (From update of attachment 182914 [details] [review]) > This patch doesn't include the change to 'banshee.log'. > That was in the first patch which I erroneously didn't mark as a patch. That's fixed now. > I'm not fond of printing "Logging to {0}" to STDERR, since it's not an error. I thought about that, but by sending it to standard out, it is effectively lost. At least by sending it to standard error, the message is available to view if the stream is redirected. Up to you, though, I can change it back and update the patch. I think the message in the ``catch`` block should go to STDERR, though.
Thanks for the patches. I merged them into one, leaving the "Logging to {0}" to STDOUT, and committed to git master.