handle method

  1. @override
Future<bool> handle(
  1. Report report,
  2. BuildContext? context
)
override

Method called when report has been accepted by user

Implementation

@override
Future<bool> handle(Report report, BuildContext? context) {
  logger
    ..info(
      '============================== '
      'CATCHER 2 LOG '
      '==============================',
    )
    ..info('Crash occurred on ${report.dateTime}')
    ..info('');
  if (enableDeviceParameters) {
    _printDeviceParametersFormatted(report.deviceParameters);
    logger.info('');
  }
  if (enableApplicationParameters) {
    _printApplicationParametersFormatted(report.applicationParameters);
    logger.info('');
  }
  logger
    ..info('---------- ERROR ----------')
    ..info('${report.error}')
    ..info('');
  if (enableStackTrace) {
    _printStackTraceFormatted(report.stackTrace);
  }
  if (enableCustomParameters) {
    _printCustomParametersFormatted(report.customParameters);
  }
  logger.info(
    '======================================================================',
  );
  return Future.value(true);
}