From: skeezix Date: Tue, 16 Feb 2010 01:19:37 +0000 (-0500) Subject: More logging in pnd_notify X-Git-Tag: Release-2010-05/1~115^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b093426b412c2d63727168443fa0b0ccb10a2a8c;p=pandora-libraries.git More logging in pnd_notify --- 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!