romain at peerfuse.org
Sat Oct 30 18:55:26 CEST 2010
I've changed things related to logging in Weboob.
Now, there is a module named weboob.tools.log. We would need to use different
loggers for each part of Weboob. The only function useful in this module is:
You can give a parent logger to complete the name of the logger, for example the
class Browser can take a parent logger, then its logger can be named like
Also, BaseBackend use a logger named by its instance name. So each instance of
backend uses a specific name.
Now, in parts which uses a specific logger, please use functions on it instead
of global logging functions. For example in a backend class, use:
There is also specific logger in BaseApplication and BaseBrowser.
Then, I've added a new parameter to BaseApplication: --logging-file. You can use
it to log into a file instead of stdout. It's useful for havesex for example,
which has several background jobs.
And the last one, the killer feature, the eye candy way: now, when log messages
are written on stdout, they are colored functions of level!
Debug messages are in blue, warning in gray and errors in red.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 489 bytes
Desc: not available
More information about the weboob