diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/NativeFileWatcherImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/NativeFileWatcherImpl.java index c2fdec64b16a..0263d6bc11ed 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/NativeFileWatcherImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/NativeFileWatcherImpl.java @@ -270,11 +270,8 @@ public class NativeFileWatcherImpl extends PluggableFileWatcher { } private void writeLine(final String line) throws IOException { - if (LOG.isDebugEnabled()) { - LOG.debug("<< " + line); - } - - final MyProcessHandler processHandler = myProcessHandler; + if (LOG.isTraceEnabled()) LOG.trace("<< " + line); + MyProcessHandler processHandler = myProcessHandler; if (processHandler != null) { processHandler.writeLine(line); } @@ -343,10 +340,8 @@ public class NativeFileWatcherImpl extends PluggableFileWatcher { return; } - final String line = event.getText().trim(); - if (LOG.isDebugEnabled()) { - LOG.debug(">> " + line); - } + String line = event.getText().trim(); + if (LOG.isTraceEnabled()) LOG.trace(">> " + line); if (myLastOp == null) { final WatcherOp watcherOp; @@ -424,9 +419,7 @@ public class NativeFileWatcherImpl extends PluggableFileWatcher { } if ((op == WatcherOp.CHANGE || op == WatcherOp.STATS) && isRepetition(path)) { - if (LOG.isDebugEnabled()) { - LOG.debug("repetition: " + path); - } + if (LOG.isTraceEnabled()) LOG.trace("repetition: " + path); return; } diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/RefreshWorker.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/RefreshWorker.java index ccaf2bf3e314..ecd14422724b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/RefreshWorker.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/RefreshWorker.java @@ -41,9 +41,11 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; -import static com.intellij.openapi.diagnostic.LogUtil.debug; import static com.intellij.openapi.util.Pair.pair; import static com.intellij.util.containers.ContainerUtil.newTroveSet; @@ -76,7 +78,7 @@ public class RefreshWorker { public void scan() { NewVirtualFile root = myRefreshQueue.pullFirst().first; boolean rootDirty = root.isDirty(); - debug(LOG, "root=%s dirty=%b", root, rootDirty); + if (LOG.isDebugEnabled()) LOG.debug("root=" + root + " dirty=" + rootDirty); if (!rootDirty) return; NewVirtualFileSystem fs = root.getFileSystem(); @@ -106,7 +108,7 @@ public class RefreshWorker { Pair pair = myRefreshQueue.pullFirst(); NewVirtualFile file = pair.first; boolean fileDirty = file.isDirty(); - debug(LOG, "file=%s dirty=%b", file, fileDirty); + if (LOG.isTraceEnabled()) LOG.trace("file=" + file + " dirty=" + fileDirty); if (!fileDirty) continue; checkCancelled(file); @@ -202,7 +204,7 @@ public class RefreshWorker { if (!fs.isCaseSensitive()) { actualNames = new OpenTHashSet(strategy, upToDateNames); } - debug(LOG, "current=%s +%s -%s", Arrays.toString(currentNames), newNames, deletedNames); + if (LOG.isTraceEnabled()) LOG.trace("current=" + Arrays.toString(currentNames) + " +" + newNames + " -" + deletedNames); List> addedMap = ContainerUtil.newArrayListWithCapacity(newNames.size()); for (String name : newNames) { @@ -221,7 +223,7 @@ public class RefreshWorker { token = ApplicationManager.getApplication().acquireReadActionLock(); try { if (!Arrays.equals(currentNames, persistence.list(dir)) || !Arrays.equals(children, dir.getChildren())) { - LOG.debug("retry"); + if (LOG.isDebugEnabled()) LOG.debug("retry: " + dir); continue; } @@ -281,8 +283,10 @@ public class RefreshWorker { actualNames = new OpenTHashSet(strategy, VfsUtil.filterNames(fs.list(dir))); } - debug(LOG, "cached=%s actual=%s", cached, actualNames); - debug(LOG, "suspicious=%s", wanted); + if (LOG.isTraceEnabled()) { + LOG.trace("cached=" + cached + " actual=" + actualNames); + LOG.trace("suspicious=" + wanted); + } // reading children attributes List> existingMap = ContainerUtil.newArrayListWithCapacity(cached.size()); @@ -302,7 +306,7 @@ public class RefreshWorker { token = ApplicationManager.getApplication().acquireReadActionLock(); try { if (!cached.equals(dir.getCachedChildren()) || !wanted.equals(dir.getSuspiciousNames())) { - LOG.debug("retry"); + if (LOG.isDebugEnabled()) LOG.debug("retry: " + dir); continue; } @@ -393,23 +397,23 @@ public class RefreshWorker { } private void scheduleAttributeChange(@NotNull VirtualFile file, @NotNull String property, Object current, Object upToDate) { - debug(LOG, "update '%s' file=%s", property, file); + if (LOG.isTraceEnabled()) LOG.trace("update '" + property + "' file=" + file); myEvents.add(new VFilePropertyChangeEvent(null, file, property, current, upToDate, true)); } private void scheduleUpdateContent(@NotNull VirtualFile file) { - debug(LOG, "update file=%s", file); + if (LOG.isTraceEnabled()) LOG.trace("update file=" + file); myEvents.add(new VFileContentChangeEvent(null, file, file.getModificationStamp(), -1, true)); } private void scheduleCreation(@NotNull VirtualFile parent, @NotNull String childName, boolean isDirectory, boolean isReCreation) { - debug(LOG, "create parent=%s name=%s dir=%b", parent, childName, isDirectory); + if (LOG.isTraceEnabled()) LOG.trace("create parent=" + parent + " name=" + childName + " dir=" + isDirectory); myEvents.add(new VFileCreateEvent(null, parent, childName, isDirectory, true, isReCreation)); } private void scheduleDeletion(@Nullable VirtualFile file) { if (file != null) { - debug(LOG, "delete file=%s", file); + if (LOG.isTraceEnabled()) LOG.trace("delete file=" + file); myEvents.add(new VFileDeleteEvent(null, file, true)); } } @@ -421,4 +425,4 @@ public class RefreshWorker { assert ApplicationManager.getApplication().isUnitTestMode(); ourCancellingCondition = condition; } -} +} \ No newline at end of file diff --git a/test-log.xml b/test-log.xml index 3108595c13ef..691aa4025043 100644 --- a/test-log.xml +++ b/test-log.xml @@ -25,11 +25,6 @@ - - - - -