title: python logging close and application exit
body: <p>I am using the logging module in an application and it occurred to me that it would be neat if the logging module supported a method which would gracefully close file handles etc and then close the application. </p>
  
  <p>For example:</p>
  
  <pre><code>logger = logging.getLogger('my_app')
  logger.fatal("We're toast!")
  </code></pre>
  
  <p>the fatal method (or some such) would then:</p>
  
  <ol>
  <li>log the message as normal</li>
  <li>logging.shutdown()</li>
  <li>Call sys.exit(1)</li>
  </ol>
  
  <p>Thoughts?
  Does something like this exist?
  Is this a bad idea? </p>
  
  <p>Why do I want this?
  Well there are a few places in my code where I want the app to die and it seems a waste to keep repeating the code to do <strong>2</strong> and <strong>3</strong>.</p>