-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
In our apps, we are catching lots of exceptions but in some cases, it would be good to have them reported back to us.
I am currently integrating crashlytics into it.
I made a CrashlyticsLogPrinter
that along with a few extra changes can work but I would still be returning an empty list.
Please suggest alternatives to this approch.
I am thinking that a custom LogOutput
might help but it works on a line by line basis, I am not sure how I can use it to write a proper log on crashlytics.
Any advice will be deeply appreciated
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:logger/logger.dart';
class CrashlyticsLogPrinter extends LogPrinter {
final String _className;
final FirebaseCrashlytics? _firebaseCrashlytics;
KodomamoCrashlyticsLogPrinter(this._className, this._firebaseCrashlytics);
@override
List<String> log(LogEvent event) {
/// This sends logs of warning level and above to Crashlytics
if (event.level.index >= Level.warning.index) {
_firebaseCrashlytics!.recordError(
event.message,
event.stackTrace,
fatal: true,
information: [_className, event.level],
printDetails: false,
);
}
return [];
}
}
Metadata
Metadata
Assignees
Labels
No labels