title: About NOTSET in python logging
body: <p>As the <a href="http://docs.python.org/2/library/logging.html#logging.Logger.setLevel" rel="noreferrer">logger.setLevel</a> doc says:</p>
  
  <blockquote>
    <p>When a logger is created, the level is set to NOTSET (which causes all messages to be processed when the logger is the root logger, or delegation to the parent when the logger is a non-root logger). Note that the root logger is created with level WARNING.</p>
  </blockquote>
  
  <p>so I think if I create a root logger, with level NOTSET, the debug and info log will display.</p>
  
  <p>The code use basicConfig to set root logger's level to NOTSET is right:</p>
  
  <pre><code>#!/usr/bin/env python
  # -*- coding: utf-8 -*-
  
  import logging
  
  logging.basicConfig(level=logging.NOTSET)
  log = logging.getLogger()
  
  log.debug('debug')
  log.info('info')
  log.warning('warning')
  log.error('error')
  log.critical('critical')
  </code></pre>
  
  <p>and output is:</p>
  
  <pre><code>DEBUG:root:debug
  INFO:root:info
  WARNING:root:warning
  ERROR:root:error
  CRITICAL:root:critical
  </code></pre>
  
  <p>But if I create a root logger, and add handler with NOTSET level to it, such as:</p>
  
  <pre><code>#!/usr/bin/env python
  # -*- coding: utf-8 -*-
  
  import logging
  
  log = logging.getLogger()
  hd = logging.StreamHandler()
  hd.setLevel(logging.NOTSET)
  log.addHandler(hd)
  
  log.debug('debug')
  log.info('info')
  log.warning('warning')
  log.error('error')
  log.critical('critical')
  </code></pre>
  
  <p>the output is:</p>
  
  <pre><code>warning
  error
  critical
  </code></pre>
  
  <p>but I think it will also output the debug and info message.</p>