On 12/9/2010 8:29 PM, Gregory P. Smith wrote:
Exactly. All I ever recommend people do is:
import logging
...
logging.warn('doing something a bit odd.')
...
for x in thing:
logging.debug('working on %r', x)
...
And be done with it. If they are controlling their __main__ they'll
probably want to call a common function to setup the log message
formatting and where it gets written to from there.
Greg -- can you flesh out that last line, to remove the need for my
parenthetical uncertainties below)?
So with your warn and debug calls, and the "common function to setup
..." (whatever this is, and however often and from where it needs to be
called in a multi-module environment) at the top of the logging manual,
it might be more approachable.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com