changeset 744:ab988e98a9f9

mod_inotify_reload: Add debug logging
author Matthew Wild <mwild1@gmail.com>
date Thu, 19 Jul 2012 15:32:02 +0100
parents 5f7dd5336dbe
children c68ce6eb97f0
files mod_inotify_reload/mod_inotify_reload.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_inotify_reload/mod_inotify_reload.lua	Mon Jul 16 22:30:43 2012 +0200
+++ b/mod_inotify_reload/mod_inotify_reload.lua	Thu Jul 19 15:32:02 2012 +0100
@@ -44,16 +44,19 @@
 	local k = host.."\0"..name;
 	watches[k] = { id = id, path = path, name = name, host = host };
 	watch_ids[id] = k;
+	module:log("debug", "Watching %s:%s with id %d", name, host, id);
 	return true;
 end
 
 function unwatch_module(name, host)
 	local k = host.."\0"..name;
 	if not watches[k] then
+		module:log("warn", "Not watching %s:%s", name, host);
 		return nil, "not-watching";
 	end
 	local id = watches[k].id;
 	local ok, err = inh:rmwatch(id);
+	module:log("info", "Removed watch %d", id);
 	watches[k] = nil;
 	watch_ids[id] = nil;
 	return ok, err;