@@ -103,15 +103,12 @@ efsw::WatchID KqueueFileWatcher::addWatch(const std::string &path,
103103 efsw::FileWatchListener *listener,
104104 bool /* _useRecursion */
105105) {
106- std::cout << " addWatch: " << path << std::endl;
107106 if (!isValid) {
108- std::cout << " FAILURE for " << path << std::endl;
109107 return efsw::Errors::WatcherFailed;
110108 }
111109
112110 int fd = open (path.c_str (), O_EVTONLY );
113111 if (fd < 0 ) {
114- std::cout << " ERROR for " << path << std::endl;
115112 switch (errno) {
116113 case ENOENT :
117114 return efsw::Errors::FileNotFound;
@@ -148,11 +145,9 @@ efsw::WatchID KqueueFileWatcher::addWatch(const std::string &path,
148145 handlesToPaths.erase (handle);
149146 handlesToListeners.erase (handle);
150147 close (fd);
151- std::cout << " WATCH FAILED FOR for " << path << std::endl;
152148 return efsw::Errors::WatcherFailed;
153149 }
154150
155- std::cout << " WATCH SUCCEEDED for " << path << std::endl;
156151 return handle;
157152}
158153
@@ -232,7 +227,6 @@ bool KqueueFileWatcher::reopenFd(efsw::WatchID handle,
232227
233228void KqueueFileWatcher::eventLoop () {
234229 while (!stopping) {
235- std::cout << " eventLoop!" << std::endl;
236230 struct kevent event;
237231 int r;
238232 do {
@@ -269,8 +263,6 @@ void KqueueFileWatcher::eventLoop() {
269263 const std::string &dir = parts.first ;
270264 const std::string &filename = parts.second ;
271265
272- std::cout << " Processing filename: " << filename << std::endl;
273-
274266 if (event.fflags & NOTE_RENAME ) {
275267 // The inode we were watching has been renamed. F_GETPATH returns its
276268 // current (new) path. We must call it before closing the fd.
@@ -288,16 +280,13 @@ void KqueueFileWatcher::eventLoop() {
288280 std::pair<std::string, std::string> newParts = SplitPath (newPath);
289281 if (parts.first != newParts.first ) {
290282 // Treat moves outside of the directory as deletions.
291- std::cout << " Action: DELETED " << watchedPath << std::endl;
292283 sendFileAction (handle, dir, filename, efsw::Actions::Delete);
293284 } else {
294- std::cout << " Action: MOVED " << newPath << std::endl;
295285 sendFileAction (handle, newParts.first , newParts.second ,
296286 efsw::Actions::Moved, filename);
297287 }
298288 } else {
299289 // F_GETPATH failed or returned the same path — treat as a deletion.
300- std::cout << " Action: DELETED " << watchedPath << std::endl;
301290 sendFileAction (handle, dir, filename, efsw::Actions::Delete);
302291 }
303292
@@ -312,19 +301,15 @@ void KqueueFileWatcher::eventLoop() {
312301 if (stat (watchedPath.c_str (), &st) == 0 &&
313302 reopenFd (handle, watchedPath)) {
314303 // A new file appeared at the same path: atomic save.
315- std::cout << " Action: CHANGED " << watchedPath << std::endl;
316304 sendFileAction (handle, dir, filename, efsw::Actions::Modified);
317305 } else {
318306 // The path is genuinely gone.
319- std::cout << " Action: DELETED " << watchedPath << std::endl;
320307 sendFileAction (handle, dir, filename, efsw::Actions::Delete);
321308 }
322309
323310 } else if (event.fflags & NOTE_WRITE ) {
324- std::cout << " Action: CHANGED " << watchedPath << std::endl;
325311 sendFileAction (handle, dir, filename, efsw::Actions::Modified);
326312 } else if (event.fflags & NOTE_ATTRIB ) {
327- std::cout << " Action: CHANGED " << watchedPath << std::endl;
328313 // macOS sometimes skips NOTE_WRITE when a file is truncated to empty,
329314 // firing NOTE_ATTRIB instead. Detect this by seeking to the end.
330315 if (lseek (fd, 0 , SEEK_END ) == 0 ) {
0 commit comments