def METHOD_NAME():
    config_file_contents = openwb_conf_path.read_text("utf-8")
    match = re.search("^debug=([012])", config_file_contents, re.MULTILINE)
    if match is None:
        logging.getLogger().setLevel(logging.DEBUG)
        log.warning("Debug setting not found in config. Assuming log-level DEBUG")
        return
    log_level_new = [logging.WARNING, logging.INFO, logging.DEBUG][int(match.group(1))]
    log_level_old = logging.getLogger().level
    if log_level_new != log_level_old:
        # Emit log message before AND after changing the level so that in case the level WAS or WILL BE >= INFO this
        # is logged:
        log_level_names = logging.getLevelName(log_level_old), logging.getLevelName(log_level_new)
        log.info("Changing log level %s -> %s", *log_level_names)
        logging.getLogger().setLevel(log_level_new)
        log.info("Log level changed %s -> %s", *log_level_names)