From 9a65686f1e169cca016d6b879f6acf09f1bde54d Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Sun, 8 Mar 2020 00:42:19 +0100 Subject: [PATCH] NotesFolder: Add more debug information when loading This will help better diagnose why files don't sometimes show up --- lib/core/notes_folder.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/core/notes_folder.dart b/lib/core/notes_folder.dart index a6386511..2971e41e 100644 --- a/lib/core/notes_folder.dart +++ b/lib/core/notes_folder.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:fimber/fimber.dart'; import 'package:path/path.dart' as p; import 'package:path/path.dart'; @@ -161,6 +162,7 @@ class NotesFolder } if (fsEntity is Directory) { + Fimber.d("Found directory ${fsEntity.path}"); var subFolder = NotesFolder(this, fsEntity.path); if (subFolder.name.startsWith('.')) { continue; @@ -177,8 +179,10 @@ class NotesFolder var note = Note(this, fsEntity.path); if (!note.filePath.toLowerCase().endsWith('.md')) { + Fimber.d("Ignoring file ${fsEntity.path}"); continue; } + Fimber.d("Found file ${fsEntity.path}"); note.addListener(_entityChanged); _notes.add(note); @@ -198,12 +202,14 @@ class NotesFolder _entityMap.remove(path); if (e is Note) { + Fimber.d("File $path was no longer found"); var i = _notes.indexWhere((n) => n.filePath == path); assert(i != -1); var note = _notes[i]; _notes.removeAt(i); notifyNoteRemoved(i, note); } else { + Fimber.d("Folder $path was no longer found"); var i = _folders.indexWhere((f) => f.folderPath == path); assert(i != -1); var folder = _folders[i];