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>logging.disable is method, not a configurable attribute.</p>

<p>You can disable logging with :</p>

<p><a href="https://docs.python.org/2/library/logging.html#logging.disable" rel="nofollow">https://docs.python.org/2/library/logging.html#logging.disable</a></p>

<p>To disable all, call:</p>

<pre><code>logging.disable(logging.DEBUG)
</code></pre>

<p>This will disable all logs of level DEBUG and below.</p>

<p>To enable all logging, do <code>logging.disable(logging.NOTSET)</code> as it is the lowest level.</p>

python python-2.7