error method
Logs an error message with optional error and stackTrace.
Implementation
void error(String message, {Object? error, StackTrace? stackTrace, Map<String, dynamic>? data}) {
final combinedData = data ?? <String, dynamic>{};
if (error != null) {
combinedData['error'] = error.toString();
}
if (stackTrace != null) {
combinedData['stack'] = stackTrace.toString();
}
_log(LogLevel.error, message, combinedData);
}