Hi
I am using standard python logging for my project. This project uses Pywikipedia and runs as a cron job every night. It therefore needs to log to a file and possibly any other configured log handler (mail, syslog etc).
However, looking at wikipedia.py it seems Pywikipedia does not use any kind of logging facility meaning that messages created by the tool are lost if not piped to a output file.
Have the developers of this helpful tool considered or discussed using standard Python logging for Pywikipedia instead print statements? Maybe I am missing something? It would be helpful to be able to configure a dedicated logger for the Pywikipedia output messages for debugging a production environment.
Regards Lee Francis
"Lee Francis Wilhelmsen" lee.francis.wilhelmsen@gmail.com wrote:
However, looking at wikipedia.py it seems Pywikipedia does not use any kind of logging facility meaning that messages created by the tool are lost if not piped to a output file.
Have the developers of this helpful tool considered or discussed using standard Python logging for Pywikipedia instead print statements? Maybe I am missing something? It would be helpful to be able to configure a dedicated logger for the Pywikipedia output messages for debugging a production environment.
This is an excellent idea. I previously suggested using the Python logging package as part of the version 2.0 rewrite (which is in an extremely early stage). But as of yet no one has delved into this issue.
The main reason for not using logging is probably just a lack of familiarity. (I note that one of our developers just recently hand-wrote his own logging functions for wikipedia.py instead of using the standard library tools.) If you would like to contribute your expertise in this area, it would be most welcome.
Russ Blau
pywikipedia-l@lists.wikimedia.org