code: def set_log_level(logger, level):  # type: (logging.Logger, int) -> None
      
      if level > 2:
          level = 2
      if level < -1:
          level = -1
  
      levels = {
          -1: logging.ERROR,
          0: logging.WARN,
          1: logging.INFO,
          2: logging.DEBUG
      }
      logger.setLevel(levels[level])
docs: Dynamic reconfiguration of the log level