title: Learning python Logging and @contextmanager, when i use "with as" , the result is confused
body: <pre><code>@contextmanager
  def log_level(level,name):
      logger=logging.getLogger(name)
      old_level=logger.getEffectiveLevel()
      try:
          logger.setLevel(level)
          yield logger
      finally:
          logger.setLevel(old_level)
  with log_level(logging.DEBUG,'my_logger') as logger:
      logger.debug('debug error')
      logging.debug('logging error')
  </code></pre>
  <p>the output is None，However when i add logging.debug('')before with as
  the output is DEBUG:my_logger:debug error</p>