title: Using a variable while calling logger.setLevel
body: <p>Does anyone know if there is a way to use a variable in the setlevel() function of Python's Logging module?</p>
  
  <p>At the moment I am using this:</p>
  
  <pre><code>Log = logging.getLogger('myLogger')
  Log.setLevel(logging.DEBUG)
  </code></pre>
  
  <p>But I'd like to have this:</p>
  
  <pre><code>Log = logging.getLogger('myLogger')
  levels = {'CRITICAL' : logging.critical,
      'ERROR' : logging.error,
      'WARNING' : logging.warning,
      'INFO' : logging.info,
      'DEBUG' : logging.debug
  }
  level = levels['INFO']
  Log.setLevel(level)
  </code></pre>
  
  <p>But it doesn't seem to work - it just doesn't log anything.</p>
  
  <p>I'm doing this so that I can set the logging level for a whole bunch of scripts from a variable in a single config file.</p>