R
R
raiboon2015-01-30 15:00:24
Django
raiboon, 2015-01-30 15:00:24

How to set logging levels for different modules in python?

I like to include it in django logging.basicConfig(level=logging.DEBUG)- it's immediately clear where the orm sends what requests and whether to rewrite it. And then I had to connect a new module... Which, "shit" with debugging information... Although no, it's more correct to say "SHIT" thousands of lines of useless debug-information.
How to set the debug level for everyone, and set the critical level for a separate one?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
thenno, 2015-01-30
@raiboon

In the general case for Python:
logging.getLogger(<logger name>).setLevel(logging.CRITICAL)
I wrote more here: thenno.me/blog/disable-logging.html

Y
yttrium, 2015-01-30
@yttrium

Django uses the dictConfig format. configuring-logging

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question