On 2010-12-12 18:42 , Glenn Linderman wrote: > 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 ) level = getattr(logging, opt.logLevel) or level = logging._levelNames[opt.logLevel] -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
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