Erweiterungen

This commit is contained in:
Sven committed 2024-05-30 10:46:38 +02:00
1 parent 054dfe616e
commit a987983b63
1 file changed
+8
+8
View File
@@ -44,6 +44,8 @@ Future<void> main() async {
PictureSchema
], directory: dir.path, name: "database_v1");
await _clearLog();
runZonedGuarded(() {}, (error, stackTrace) {
_traceUncaughtExceptions(error, stackTrace);
});
@@ -51,6 +53,12 @@ Future<void> main() async {
runApp(MyApp());
}
Future<void> _clearLog() async {
var dateTime = DateTime.now().add(const Duration(days: -7));
await MyApp.isarInstance.logEntrys.where().filter().timeLessThan(dateTime).deleteAll();
}
void _traceUncaughtExceptions(Object error, StackTrace stackTrace) {
Util.logException('Ein Fehler ist aufgetreten: $error');
Util.logException('Stack-Trace: $stackTrace');