def getLogger(config):
    try:
        d = config.getVal('logger')
    except Exception as e:
        print >> sys.stderr, "Error: config does not have 'logger' section"
        exit(1)

    classname = d.get('class', None)
    if classname is None:
        print >> sys.stderr, "Logger section is missing the class key."
        exit(1)

    LoggerClass = globals().get(classname, None)
    if LoggerClass is None:
        print >> sys.stderr, classname % "Logger class (%s) is not defined."
        exit(1)

    kwargs = d.get('kwargs', None)
    if kwargs is None:
        print >> sys.stderr, "Logger section is missing the kwargs key."
        exit(1)

    try:
        logger = LoggerClass(config, **kwargs)
    except Exception as e:
        print >> sys.stderr, "An error occured initialising the logger class"
        print e
        exit(1)

    return logger
dataset/ETHPy150Open thinkst/opencanary/opencanary/logger.py/getLogger/swapped operands of `%`