logError method
void
logError(})
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
}
}