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

Glenn Linderman v+python at g.nevcal.com
Mon Dec 13 01:42:49 CET 2010


On 12/12/2010 2:26 PM, Paul Moore wrote:
> The thing*I*  hit very early was wanting to add a command lime option
> to my script to set the logging level. I'd have liked to be able to
> add --log=INFO/DEBUG/... but to do that I seem to need to write my own
> mapping between level names and numbers. A simple example of how to
> tie command line options to logging config would be a great addition
> to the documentation.

Oh?

import * from logger # change some details to avoid this
basicConfig( level= eval( opt.loglevel )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20101212/d632f9e0/attachment.html>


More information about the Python-Dev mailing list