def setup_logger(logger_name, logger_level=logging.DEBUG, handlers=None,
                 remove_existing_handlers=True):

    logger = logging.getLogger(logger_name)

    if remove_existing_handlers:
        for handler in logger.handlers:
            logger.removeHandler(handler)

    if not handlers:
        handler = logging.StreamHandler(sys.stdout)
        handler.setLevel(logging.DEBUG)
        handlers = [handler]

    formatter = logging.Formatter(fmt='%(asctime)s [%(levelname)s] '
                                      '[%(name)s] %(message)s',
                                  datefmt='%d/%m/%Y %H:%M:%S')
    for handler in handlers:
        handler.setFormatter(formatter)
        logger.addHandler(handler)

    logger.setLevel(logger_level)
    return logger
:param logger_name: Name of the logger.
dataset/ETHPy150Open cloudify-cosmo/cloudify-manager/rest-service/manager_rest/utils.py/setup_logger