Hi.
I did not find any crash situation or bug to fix. I just tried to
understand what was the root cause of the "missing logger" message, someone
was complaining about. Which I described above (always assuming it is the
correct one ...).
Bye
Mpaa
On Sun, Sep 1, 2013 at 12:14 PM, Dr. Trigon <dr.trigon(a)surfeu.ch> wrote:
-----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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -
http://www.enigmail.net/
iEYEARECAAYFAlIjE3sACgkQAXWvBxzBrDDmXgCfeIIR7uWq9kzPZKDYyrtEwIHa
5gcAoMzc9nVnpfF1+X4L/HLk3OSDuKPq
=kqcg
-----END PGP SIGNATURE-----
_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l