import logging


def set_parsl_logging(bps_config):
    """Set parsl logging levels."""
    config = dict(bps_config['parsl_config'])
    parsl_log_level = config.get('log_level', 'logging.INFO')
    loggers = [_ for _ in logging.root.manager.loggerDict
               if _.startswith('parsl')]
    log_level = eval(parsl_log_level)
    for logger in loggers:
        logging.getLogger(logger).setLevel(log_level)
    return log_level