title: python logging print traceback only in debug
body: <p>I am currently loading the python logger like this:</p>
  
  <pre><code>import logging
  logging.basicConfig(level=logging.INFO)
  log = logging.getLogger("myprogram")
  </code></pre>
  
  <p>and using it e. g. like this:</p>
  
  <pre><code>[...]
  except FileNotFoundError:
      log.exception("could not open configuration file")
      sys.exit(1)
  </code></pre>
  
  <p>However, this will always print the traceback along with the error message:</p>
  
  <pre><code>ERROR:myprogram:could not open configuration file
  Traceback (most recent call last):
  [...]
  FileNotFoundError: [Errno 2] No such file or directory: 
  'not/existing/file.yml'
  </code></pre>
  
  <p>I do not want the traceback in the normal error output. Instead it should only print my error message and the exception info ("No such file...").</p>
  
  <p>What is the recommended way of showing the traceback only when the loglevel is set to <code>logging.DEBUG</code>?</p>