code: def should_log(self, logger_name: str, level: str) -> bool:
          
          if (logger_name, level) not in self._should_log:
              log_level_per_rule = self._get_log_level(logger_name)
              log_level_per_rule_numeric = getattr(logging, log_level_per_rule.upper(), 10)
              log_level_event_numeric = getattr(logging, level.upper(), 10)
  
              should_log = log_level_event_numeric >= log_level_per_rule_numeric
              self._should_log[(logger_name, level)] = should_log
          return self._should_log[(logger_name, level)]
docs: Returns if a message for the logger should be logged.