shouldLog method

bool shouldLog({
  1. LogEvent? event,
})

Determines whether a log operation should proceed based on the event and log level.

event - Optional. The specific log event being checked. If provided, the method checks whether the event is supported by this strategy. Returns true if the log should be processed, false otherwise.

Implementation

bool shouldLog({LogEvent? event}) {
  if (event != null) {
    return supportedEvents?.contains(event) ?? true;
  } else {
    return logLevel.index <= loggerLogLevel.index;
  }
}