From b093426b412c2d63727168443fa0b0ccb10a2a8c Mon Sep 17 00:00:00 2001 From: skeezix Date: Mon, 15 Feb 2010 20:19:37 -0500 Subject: [PATCH] More logging in pnd_notify --- lib/pnd_notify.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/pnd_notify.c b/lib/pnd_notify.c index 83e8d8d..03b8295 100644 --- a/lib/pnd_notify.c +++ b/lib/pnd_notify.c @@ -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! -- 2.39.5