From cf3c9bddc60ee2eef7d0bf7cf025ca37ba457f37 Mon Sep 17 00:00:00 2001 From: Dennis Fokin Date: Tue, 10 Dec 2024 14:36:01 +0100 Subject: [PATCH] Add logging --- lib/desktop/init.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/desktop/init.dart b/lib/desktop/init.dart index c514f2dbf..a561cba78 100755 --- a/lib/desktop/init.dart +++ b/lib/desktop/init.dart @@ -131,7 +131,8 @@ Future initialize(List argv) async { try { prefs = await SharedPreferences.getInstance(); } catch (error) { - // Attempt to repair the broken preferences file + _log.warning( + 'Failed to load the preferences file. Attempting to repair it.'); Directory appSupportDirectory = await getApplicationSupportDirectory(); String appDataPath = path.join(appSupportDirectory.path, 'shared_preferences.json'); @@ -140,7 +141,8 @@ Future initialize(List argv) async { try { prefs = await SharedPreferences.getInstance(); } catch (error) { - // Unable to repair the preferences file, therefore delete it + _log.warning( + 'Failed to repair the preferences file. Deleting the file and proceeding with a fresh configuration.'); await File(appDataPath).delete(); prefs = await SharedPreferences.getInstance(); }