logError method

  1. @override
void logError(
  1. String message,
  2. String errorDetails, {
  3. Level level = Level.error,
})
override

Logs an error message with additional details.

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

message: The error message to be logged. errorDetails: Additional error details (e.g., exception message or stack trace). level: The log level for the error message (defaults to Level.error).

Implementation

@override
void logError(String message, String errorDetails,
    {Level level = Level.error}) {
  if (_enableLogging) {
    _logger.log(level,
        "$message. Details: $errorDetails"); // Logs error message with additional details
  }
}