error method
Logs a message at the ERROR
level.
Used when an operation fails but the app can still continue.
Example:
log.error('Failed to load configuration file.', error: e, stacktrace: s);
Implementation
void error(String message, {Object? error, StackTrace? stacktrace}) {
add(LogLevel.ERROR, message, error: error, stacktrace: stacktrace);
}