log method

  1. @override
void log(
  1. String message, {
  2. Level level = Level.info,
})
override

Logs a general message to the logger.

This method logs a message at the specified log level (defaults to Level.info). If logging is disabled, no logs will be generated.

message: The message to be logged. level: The log level for the message (e.g., info, warning, error). Defaults to Level.info.

Implementation

@override
void log(String message, {Level level = Level.info}) {
  if (_enableLogging) {
    _logger.log(
        level, message); // Logs the message using the provided log level
  }
}