logError method
void
logError({
- required dynamic error,
- StackTrace? stackTrace,
- required String file,
- required String event,
Logs an error
and a stackTrace
in a specific file
during a specific event
.
Implementation
void logError({
required dynamic error,
StackTrace? stackTrace,
required String file,
required String event,
}) {
if (kReleaseMode) {
return;
}
stackTrace ??= StackTrace.current;
log(
"Error occurred in file $file during event: $event",
level: _getLevel(error),
error: error,
stackTrace: stackTrace,
);
}