diff mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 3462:d73ed7975d82

mod_storage_xmlarchive: Add some debug logging
author Kim Alvefur <zash@zash.se>
date Thu, 07 Feb 2019 15:26:03 +0100
parents 41e1cacf3c4e
children 4e9d4b07e3e9
line wrap: on
line diff
--- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua	Sun Feb 03 21:36:31 2019 +0100
+++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua	Thu Feb 07 15:26:03 2019 +0100
@@ -66,6 +66,7 @@
 			local items = dm.list_load(username .. "@" .. dates[d], self.host, self.store) or empty;
 			for i = 1, #items do
 				if items[i].id == id then
+					module:log("debug", "Found item!");
 					return d, i, items;
 				end
 			end
@@ -73,9 +74,11 @@
 				return; -- Assuming no duplicates
 			end
 		elseif date and date < dates[d] then
+			module:log("debug", "Skipping remaining dates after %s", date);
 			return; -- List is assumed to be sorted
 		end
 	end
+	module:log("debug", "Item not found");
 end
 
 function archive:find(username, query)