提交 2aa335b9 编写于 作者: M Martin Aeschlimann

Add log messages for watchers

上级 14583638
......@@ -100,6 +100,10 @@ export class NsfwWatcherService implements IWatcherService {
}
}
if (this._verboseLogging) {
this.log(`Start watching with nsfw: ${request.path}`);
}
nsfw(request.path, events => {
for (const e of events) {
// Logging
......
......@@ -105,15 +105,9 @@ export class ChokidarWatcherService implements IWatcherService {
}
private _watch(basePath: string, requests: IWatcherRequest[]): IWatcher {
if (this._verboseLogging) {
this.log(`Start watching: ${basePath}]`);
}
const pollingInterval = this._pollingInterval || 5000;
const usePolling = this._usePolling;
if (usePolling && this._verboseLogging) {
this.log(`Use polling instead of fs.watch: Polling interval ${pollingInterval} ms`);
}
const watcherOpts: chokidar.WatchOptions = {
ignoreInitial: true,
......@@ -155,6 +149,10 @@ export class ChokidarWatcherService implements IWatcherService {
this.warn(`Watcher basePath does not match version on disk and was corrected (original: ${basePath}, real: ${realBasePath})`);
}
if (this._verboseLogging) {
this.log(`Start watching with chockidar: ${realBasePath}, excludes: ${excludes.join(',')}, usePolling: ${usePolling ? 'true, interval ' + pollingInterval : 'false'}`);
}
let chokidarWatcher: chokidar.FSWatcher | null = chokidar.watch(realBasePath, watcherOpts);
this._watcherCount++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册