From 011c40d31bd4e655a23fdf44922781f4fcce7a08 Mon Sep 17 00:00:00 2001 From: Herbert Poul Date: Fri, 30 Jul 2021 16:05:05 +0200 Subject: [PATCH] better debugging output for merging. --- lib/src/kdbx_format.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/src/kdbx_format.dart b/lib/src/kdbx_format.dart index 1a13998..c028d9f 100644 --- a/lib/src/kdbx_format.dart +++ b/lib/src/kdbx_format.dart @@ -467,6 +467,10 @@ class MergeContext implements OverwriteContext { final List changes = []; final List warnings = []; + int totalChanges() { + return deletedObjects.length + changes.length; + } + void markAsMerged(KdbxObject object) { if (merged.containsKey(object.uuid)) { throw StateError( @@ -499,6 +503,15 @@ class MergeContext implements OverwriteContext { ].join('\n ')) .join('\n'); } + + String debugSummary() { + return 'Changes: ${changes.length}, Deleted: ${deletedObjects.length}, Warnings: ${warnings.join(', ')}'; + } + + @override + String toString() { + return '$runtimeType{${debugSummary()}'; + } } class _KeysV4 {