提交 da35479b 编写于 作者: D Daniel Imms

Improve nsfw logging

上级 25ab8aaa
......@@ -30,15 +30,17 @@ export class NsfwWatcherService implements IWatcherService {
return new TPromise<void>((c, e, p) => {
nsfw(request.basePath, events => {
for (let i = 0; i < events.length; i++) {
const e = events[i];
// Logging
if (request.verboseLogging) {
console.log('raw events start');
events.forEach(e => console.log(e));
console.log('raw events end');
const logPath = e.action === nsfw.actions.RENAMED ? path.join(e.directory, e.oldFile) + ' -> ' + e.newFile : path.join(e.directory, e.file);
console.log(e.action === nsfw.actions.CREATED ? '[CREATED]' : e.action === nsfw.actions.DELETED ? '[DELETED]' : e.action === nsfw.actions.MODIFIED ? '[CHANGED]' : '[RENAMED]', logPath);
}
for (let i = 0; i < events.length; i++) {
// Convert nsfw event to IRawFileChange and add to queue
let absolutePath: string;
const e = events[i];
if (e.action === nsfw.actions.RENAMED) {
// Rename fires when a file's name changes within a single directory
absolutePath = path.join(e.directory, e.oldFile);
......
......@@ -12,9 +12,8 @@ import uri from 'vs/base/common/uri';
import { toFileChangesEvent, IRawFileChange } from 'vs/workbench/services/files/node/watcher/common';
import { IWatcherChannel, WatcherChannelClient } from 'vs/workbench/services/files/node/watcher/unix/watcherIpc';
import { FileChangesEvent } from 'vs/platform/files/common/files';
import { IFileWatcher } from "vs/workbench/services/files/node/watcher/unix/watcher";
export class FileWatcher implements IFileWatcher {
export class FileWatcher {
private static MAX_RESTARTS = 5;
private isDisposed: boolean;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册