LoggingBugfenderListener constructor

LoggingBugfenderListener(
  1. String appKey, {
  2. Uri? apiUri,
  3. Uri? baseUri,
  4. int? maximumLocalStorageSize,
  5. PrintStrategy consolePrintStrategy = const NeverPrintStrategy(),
  6. PrintStrategy bugfenderPrintStrategy = const PlainTextPrintStrategy(),
  7. bool enableUIEventLogging = true,
  8. bool enableCrashReporting = true,
  9. bool enableAndroidLogcatLogging = true,
})

Creates a LoggingBugfenderListener. You probably want to call listen just after creating it.

The appKey is your secret app key from Bugfender.

The apiUri and baseUri are the alternative URLs for on-premise installations.

The maximumLocalStorageSize is a maximum size the log cache will use, in bytes.

The consolePrintStrategy decides if and how logs are printed to the console.

The bugfenderPrintStrategy decides if and how logs are sent to Bugfender.

The sendToBugfender decides whether to send logs to bugfender. If it is set to false, then logs will be printed only locally, to your console.

The enableUIEventLogging enables automatic logging of user interactions. Defaults to true.

The enableCrashReporting enables automatic crash reporting. Defaults to true.

The enableAndroidLogcatLogging enables automatic logging of Logcat (only on Android). Defaults to true. This may result in logging many unrelevant records.

Implementation

LoggingBugfenderListener(
  String appKey, {
  Uri? apiUri,
  Uri? baseUri,
  int? maximumLocalStorageSize,
  this.consolePrintStrategy = const NeverPrintStrategy(),
  this.bugfenderPrintStrategy = const PlainTextPrintStrategy(),
  bool enableUIEventLogging = true,
  bool enableCrashReporting = true,
  bool enableAndroidLogcatLogging = true,
}) {
  unawaited(
    FlutterBugfender.init(
      appKey,
      apiUri: apiUri,
      baseUri: baseUri,
      maximumLocalStorageSize: maximumLocalStorageSize,
      printToConsole: false, // we do console printing ourselves
      enableUIEventLogging: enableUIEventLogging,
      enableCrashReporting: enableCrashReporting,
      enableAndroidLogcatLogging: enableAndroidLogcatLogging,
    ),
  );
}