title: Python Logging - How To Check If Logger Is Empty
body: <p>I just implemented logging in my app, and I'd like to know if there's a method to check if a logger is empty or not.  </p>
  
  <p>What I have in mind is to set two handlers in my script:</p>
  
  <ul>
  <li>One for console with level <code>WARNING</code></li>
  <li>One for file with level <code>DEBUG</code></li>
  </ul>
  
  <p>At the end of the script, I need to check if <code>CONSOLE</code> logger is not empty. This means that during the run, some messages with <code>level &gt;= WARNING</code> were logged, and in this case I'd like to send the log file with debug level thru <code>smtp</code>to my mailbox.</p>
  
  <p>Is this check possible inside the <code>python</code> script itself, without shell redirection to file?  </p>