A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-December/106655.html below:

[Python-Dev] Using logging in the stdlib and its unit tests

[Python-Dev] Using logging in the stdlib and its unit tests [Python-Dev] Using logging in the stdlib and its unit testsGlenn Linderman v+python at g.nevcal.com
Fri Dec 10 09:36:57 CET 2010
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20101210/b7461b44/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4