title: why does python logging level in basicConfig have no effect?
body: <pre><code>import logging
  
  # root logger
  root = logging.getLogger()      # root
  ch = logging.StreamHandler()
  ch.setLevel(logging.WARN)
  formatter = logging.Formatter('[root] %(levelname)s - %(message)s')
  ch.setFormatter(formatter)
  root.addHandler(ch)
  
  # logging as child
  c = logging.getLogger('mod')
  c.setLevel(logging.DEBUG)
  ch = logging.StreamHandler()
  ch.setLevel(logging.DEBUG)
  formatter = logging.Formatter('[mod] - %(levelname)s - %(message)s')
  ch.setFormatter(formatter)
  c.addHandler(ch)
  
  c.error('foo')
  c.warning('foo')
  c.info('foo')
  c.debug('foo')
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>[mod] - ERROR - foo
  [root] ERROR - foo
  [mod] - WARNING - foo
  [root] WARNING - foo
  [mod] - INFO - foo
  [mod] - DEBUG - foo
  </code></pre>
  
  <p>It's OK. Level of root is <code>WARN</code>, so <code>INFO</code> and <code>DEBUG</code> of root is not printed.
  But when I use <code>basicConfig</code>:</p>
  
  <pre><code>import logging
  
  # config root logger
  logging.basicConfig(level=logging.WARN, format='[root] %(levelname)s - %(message)s')
  
  # logging as child
  c = logging.getLogger('mod')
  c.setLevel(logging.DEBUG)
  ch = logging.StreamHandler()
  ch.setLevel(logging.DEBUG)
  formatter = logging.Formatter('[mod] - %(levelname)s - %(message)s')
  ch.setFormatter(formatter)
  c.addHandler(ch)
  
  c.error('foo')
  c.warning('foo')
  c.info('foo')
  c.debug('foo')
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>[mod] - ERROR - foo
  [root] ERROR - foo
  [mod] - WARNING - foo
  [root] WARNING - foo
  [mod] - INFO - foo
  [root] INFO - foo
  [mod] - DEBUG - foo
  [root] DEBUG - foo
  </code></pre>
  
  <p>The level of <code>basicConfig</code> is <code>WARN</code>, why level <code>INFO</code> and <code>DEBUG</code> of root can be printed?</p>
  
  <p>And when I use <code>logging.info</code>, it effects.</p>