-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 01.09.2013 01:56, Mpaa wrote:
Hi.
My 2 cents ... on compat regarding the message about logging handlers.
When no log is required, log.log(_level, text, extra=context, **kwargs) in wikipedia.logoutput() actually has no handlers and no parents (root) with handlers. Then, from here the statement that no handlers are defined for pywiki.
If logs are required by param settings, wikipedia.setLogfileStatus() defines a handler for logger 'root', which will become parent of the above "log" in wikipedia.logoutput(). "log" still has no handlers but the logging module will look for parents of "log". now finding them.
Maybe it is too late here ... for this to be accurate ...
The implementation is very convoluted, with globals variables and local variables, several call to init functions, confusing names (e.g. "log" is a method of a logger object, a function, etc.) If you share this opinion, a refactoring would be appropriate?
What you see there is the result of a refactoring of the very ancient mode trunk/compat used; it just dumped to file without timestamp and else. Since core on the other hand had/has a very clean implementation using the logging module, I started a transition from "just dump to file" to using the logging module as core does in order to finally converge with compat against core.
So you are charging an open door - that was the reason why I asked for "can you give me more details please" e.g. a description and a traceback of an actual crash situation? That would give me a point to start on and fix this concrete bug as well as improve the situation overall.
Of course you can also implement your own changes - I would be happy to review them - but please keep in mind you have to be very careful not to break things here. E.g. a message that no logger is defined is annoying indeed, but does not break the code to run...
Greetings DrTrigon