logError method
Future<void>
logError(
- dynamic error,
- StackTrace? stackTrace,
- LogEvent? event,
- Map<
String, dynamic> ? context,
Legacy method for logging errors (for backward compatibility).
Legacy implementations: Override this method to maintain compatibility with older code.
This method now receives context automatically, even if your strategy was written before v1.4.0.
New implementations: Override error() and fatal() instead.
error - The error to log.
stackTrace - Optional. The stack trace associated with the error.
event - Optional. The specific log event associated with the error.
context - Optional. Additional context data (now available automatically!).
Implementation
Future<void> logError(
dynamic error,
StackTrace? stackTrace,
LogEvent? event,
Map<String, dynamic>? context,
) async {
// Default: empty implementation
// Legacy strategies should override this method
}