LoggingBugfenderListener constructor
- String appKey, {
- Uri? apiUri,
- Uri? baseUri,
- int? maximumLocalStorageSize,
- PrintStrategy consolePrintStrategy = const NeverPrintStrategy(),
- PrintStrategy bugfenderPrintStrategy = const PlainTextPrintStrategy(),
- bool enableUIEventLogging = true,
- bool enableCrashReporting = true,
- 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,
),
);
}