Taking some pain out of Python logging(hynek.me)
hynek.me
Taking some pain out of Python logging
http://hynek.me/articles/taking-some-pain-out-of-python-logging/
3 comments
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&...
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&...
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.
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.
In the examples, I set the log level to INFO for instance.
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.