Log disabling in python
<p>I am new to this logging module.</p>

<pre><code>logging.basicConfig(level=logging.DEBUG)
logging.disable = True
</code></pre>

<p>As per my understanding this should disable debug logs. But when it is  executed it prints debug logs also.</p>

<p>I have only debug logs to print. I dont have critical or info logs. So how i can disable this debug logs.</p>

<p>the <code>level</code> argument in <code>logging.basicConfig</code> you've set to <code>logging.DEBUG</code> is the lowest level of logging which will be displayed.
the order of logging levels is documented <a href="https://docs.python.org/2/library/logging.html#logging-levels" rel="nofollow">here</a>. </p>

<p>if you don't want to display DEBUG, you can either set <code>logging.basicConfig(level=logging.INFO)</code>, or specify levels to be disabled via <code>logging.disable(logging.DEBUG)</code></p>

python python-2.7