'Setup loglevel.
Convenience function to support lowercase names.
levelName: level name from LEVELS'

def setLogLevel(self, levelname=None):

    level = LOGLEVELDEFAULT
    if (levelname is not None):
        if (levelname not in LEVELS):
            raise Exception('unknown    levelname    seen    in    setLogLevel')
        else:
            level = LEVELS.get(levelname, level)
    self.setLevel(level)
    self.handlers[0].setLevel(level)
