From 9b01f4528c428063fdbd8d45d59d18b897f2a8bb Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Mon, 18 Oct 2021 00:20:39 +0530 Subject: [PATCH] Fix disk log roation --- lib/super_logging.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/super_logging.dart b/lib/super_logging.dart index 9ad721d..cbcd2f2 100644 --- a/lib/super_logging.dart +++ b/lib/super_logging.dart @@ -235,6 +235,7 @@ class _SuperLogging { try { DateTime date = config.dateFmt.parse(basename(file.path)); dates[file] = date; + files.add(file); } on FormatException {} } @@ -247,7 +248,9 @@ class _SuperLogging { List toDelete = files.sublist(0, extra); for (File file in toDelete) { - await file.delete(); + try { + await file.delete(); + } catch (ignore) {} } }