

Taking some pain out of Python logging - roguelynn
http://hynek.me/articles/taking-some-pain-out-of-python-logging/

======
mixmastamyk
I agree that python logging is a bit homely, but didn't understand the up-
front reasoning of this post, specifically the NIH part. I believe Python
logging was modeled after Java logging which is why it is designed the way it
is. Plenty of flexibility and lots of the associated grunt work too.

It needs to run under windows so hardcoding it to use syslog wouldn't make
much sense, though I suppose the defaults per platform could be better.

Also, why is it important how Twisted does it? I don't see why one would use
Twisted logging now that it exists in the stdlib.

Still I did enjoy the tips on using the syslog with python.

------
shill
Working with the standard library logging module does make me feel like I have
stepped out of Python land temporarily. But it does its job, and once it is
configured for a project, I don't really think about it again.

Also, the maintainer of the module, Vinay Sajip, is on Stack Overflow and
regularly answers logging questions _.

_
[https://www.google.com/search?hl=en&as_q=python+logging&...](https://www.google.com/search?hl=en&as_q=python+logging&as_epq=&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=stackoverflow.com&as_occt=any&safe=images&tbs=&as_filetype=&as_rights=#hl=en&lr=&as_qdr=all&q=python+logging+vinay+sajip+site:stackoverflow.com&oq=python+logging+vinay+sajip+site:stackoverflow.com&gs_l=serp.3...7414.7521.0.7824.2.2.0.0.0.1.129.257.0j2.2.0.les%3B..0.0...1c.1.5.serp.c-pUJxHpIgs&bav=on.2,or.r_gc.r_pw.&bvm=bv.43287494,d.aWM&fp=fb46c956e1f55c6c&biw=1440&bih=758)

------
ajanuary
Presumably with this method you can't selectively increase and decrease log
levels for different components? That can be really useful in a large system
where you don't want to generate several gigs of logging to sift through all
the time, but sometimes you do want that extra detail to track down a tricky
bug.

~~~
hynek
You can because you’re still using logging if you want. You only use a
different ‘Handler’ which writes your entries to stderr instead of into a
file. That’s the advantage of logging’s modularity.

In the examples, I set the log level to INFO for instance.

