After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 644270 - Uncaught exception crashes Banshee if the log cannot be opened
Uncaught exception crashes Banshee if the log cannot be opened
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: general
git master
Other Windows
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-09 01:10 UTC by Dustin C. Hatch
Modified: 2012-03-11 13:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to suppress exceptions when opening the log file (1.54 KB, patch)
2011-03-09 01:10 UTC, Dustin C. Hatch
none Details | Review
Patch to send non-redirected messages to StdErr (1.48 KB, patch)
2011-03-09 01:46 UTC, Dustin C. Hatch
needs-work Details | Review

Description Dustin C. Hatch 2011-03-09 01:10:24 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)
Comment 1 Dustin C. Hatch 2011-03-09 01:46:59 UTC
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 2 Gabriel Burt 2011-03-09 19:39:19 UTC
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.
Comment 3 Dustin C. Hatch 2011-03-09 19:54:11 UTC
(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.
Comment 4 Bertrand Lorentz 2012-03-11 13:16:27 UTC
Thanks for the patches.
I merged them into one, leaving the "Logging to {0}" to STDOUT, and committed to git master.