def initLogger(name):  # pylint: disable=invalid-name
    '''
    Initializes a basic logger. Can be replaced when constructing the
    HttpApi object or afterwards with setter
    '''
    logger = logging.getLogger(name)
    logger.setLevel(logging.INFO)
    # Skip attaching StreamHandler if one is already attached to logger
    if not getattr(logger, "streamhandler_set", None):
        consolehandler = logging.StreamHandler()
        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
        consolehandler.setFormatter(formatter)
        consolehandler.setLevel(logging.INFO)
        logger.addHandler(consolehandler)
        logger.streamhandler_set = True
    return logger
def initLogger ( name ) : logger = logging . getLogger ( name ) logger . setLevel ( logging . INFO ) if not getattr ( logger , "streamhandler_set" , None ) : consolehandler = logging . StreamHandler ( ) formatter = logging . Formatter ( '%(asctime)s - %(name)s - %(levelname)s - %(message)s' ) consolehandler . setFormatter ( formatter ) consolehandler . setLevel ( logging . INFO ) logger . addHandler ( consolehandler ) logger . streamhandler_set = True return logger
Initializes a basic logger. Can be replaced when constructing the
    HttpApi object or afterwards with setter