GNOME Bugzilla – Bug 755890
giscanner.message: Fix module-level logging functions
Last modified: 2015-10-01 07:30:01 UTC
The functions in the module message obtain the MessageLogger instance by calling MessageLogger.get(). The constructor signature of MessageLogger, however, requires one mandatory parameter to be used, that is, the namespace. To make the functions actually work rather than raising a bogus exception, allow the logger to be constructed without a namespace parameter.
Created attachment 312439 [details] [review] giscanner.message: Fix module-level logging functions MessageLogger.get() calls the class constructor without arguments. The __init__ signature, however, did not default the namespace parameter, so any usage of the logging functions caused a bogus exception.
Review of attachment 312439 [details] [review]: Okay, how did this work before? What are birds? We just don't know.
(In reply to Colin Walters from comment #2) > Review of attachment 312439 [details] [review] [review]: > > Okay, how did this work before? What are birds? We just don't know. My guess is, any tools that cared for messages prime the logger instance in the main function with something for the namespace, which means any successive MessageLogger.get() gets the same instance regardless of its parameters. Odd design, that. Note also that enable_warnings() has to be called on the logger with a list of log levels, otherwise no messages will be printed.