def add_handlers(logger, handlers):
    """
    Add handlers to logger ensuring they do not already exist

    Parameters
    ----------
    logger : logging.logger
        Logger to add handlers to
    handlers : list
        Handlers to add to logger

    Returns
    -------
    logger : logging.logger
        Logger with updated handlers
    """
    current_handlers = {h.name: h for h in logger.handlers}
    for handler in handlers:
        name = handler.name
        if name not in current_handlers:
            logger.addHandler(handler)
            current_handlers.update({name: handler})
        else:
            h = current_handlers[name]
            if handler.level < h.level:
                h.setLevel(handler.level)

    return logger