Skip to content

Commit

Permalink
Write failed watcher init attempts to log file
Browse files Browse the repository at this point in the history
Summary:
I have seen Watchman use the inotify watcher instead of the edenfs watcher for an EdenFS (FUSE) repository. Unfortunately, Watchman didn't report why it couldn't use the edenfs watcher.

Whenever Watchman falls back to a lower-quality watcher (such as kqueue on macOS), log what the problem with the higher-quality watcher was.

Reviewed By: wez

Differential Revision: D12742390

fbshipit-source-id: 935031f66ee5be2d41b098b6ce7e34f6a2a32ca0
  • Loading branch information
Matt Glazar authored and facebook-github-bot committed Oct 31, 2018
1 parent a9055db commit fd590f2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion watcher/auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,13 @@ std::shared_ptr<watchman::QueryableView> WatcherRegistry::initWatcher(
// in this case
break;
} catch (const std::exception& e) {
watchman::log(watchman::DBG, watcher->getName(), ": ", e.what(), ".\n");
watchman::log(
watchman::ERR,
"failed to use watcher ",
watcher->getName(),
": ",
e.what(),
".\n");
failureReasons.append(
watcher->getName() + std::string(": ") + e.what() +
std::string(". "));
Expand Down

0 comments on commit fd590f2

Please sign in to comment.