trackError method

Future<void> trackError(
  1. Object error, {
  2. StackTrace? stackTrace,
  3. String? message,
  4. bool fatal = false,
})

Records an error to logger.

Set fatal to true to mark the event at LogLevel.fatal.

Implementation

Future<void> trackError(
  Object error, {
  StackTrace? stackTrace,
  String? message,
  bool fatal = false,
}) {
  return logger.log(
    fatal ? LogLevel.fatal : LogLevel.error,
    message ?? error.toString(),
    error: error,
    stackTrace: stackTrace,
    context: trackerContext,
  );
}