[stdlib-sig] logging

Thomas Heller theller at ctypes.org
Fri Sep 18 19:40:21 CEST 2009


Vinay Sajip schrieb:
> Thomas Heller <theller at ...> writes:
>> 
>> Although I like and use logging, I belong more to the hatred people
>> for the logging configuration.
>> 
> 
> I don't blame you. It's partly, though not all, a ConfigParser thing. The
> difficulty for me with configuration is, there's very little chance of a
> consensus for how it should work. Everybody will have their opinion, they'll all
> have good points, but nobody will agree :-( Backwards compatibility might be
> manageable, if we stick to a ConfigParser format and introduce a "version" key
> somewhere.

You should be fine with me: I don't care because I don't the config files.

>> What I am really missing is a way to do basic logging configuration (calling
>> logging.basicConfig(...)) with some command line args for the Python
>> interpreter.  I have suggested that before IIRC, but it doesn't seem to fly.
> 
> Can you point me to a ticket or post about it?

I'm not sure there is a ticket or feature request for it - probably not.
What I would like to see is something like this:

python -L level=DEBUG script.py scriptargs ...

which then calls
import logging; logging.basicConfig(level=logging.DEBUG)

Unfortunately it's not possible to access command line arguments in sitecustomize.py,
otherwise I would have hacked it there...

-- 
Thanks,
Thomas


More information about the stdlib-sig mailing list