More logging in pnd_notify
authorskeezix <skeezix@flotsam-vm.(none)>
Tue, 16 Feb 2010 01:19:37 +0000 (20:19 -0500)
committerskeezix <skeezix@flotsam-vm.(none)>
Tue, 16 Feb 2010 01:19:37 +0000 (20:19 -0500)
lib/pnd_notify.c

index 83e8d8d..03b8295 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "pnd_notify.h"
 #include "pnd_pathiter.h"
+#include "pnd_logger.h"
 
 typedef struct {
   int fd;              // notify API file descriptor
@@ -72,6 +73,10 @@ static int pnd_notify_callback ( const char *fpath, const struct stat *sb,
 
   inotify_add_watch ( notify_handle, fpath, PND_INOTIFY_MASK );
 
+  if ( pnd_log_do_buried_logging() ) {
+    pnd_log ( PND_LOG_DEFAULT, "notify callback: added watch on %s\n", fpath );
+  }
+
   return ( 0 ); // continue the tree walk
 }
 
@@ -162,8 +167,8 @@ unsigned char pnd_notify_rediscover_p ( pnd_notify_handle h ) {
     /* do it!
      */
 
-    if ( e -> len ) {
-      //printf ( "Got event against '%s'\n", e -> name );
+    if ( pnd_log_do_buried_logging() ) {
+      pnd_log ( PND_LOG_DEFAULT, "notify: Got event against '%s' [%u %x]\n", e -> name, e -> mask, e -> mask );
     }
 
     /* do it!