Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
odisseus committed Dec 10, 2024
1 parent 08c145e commit b03028f
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.idea.blaze.base.sync.status.BlazeSyncStatus;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.AsyncFileListener;
import com.intellij.openapi.vfs.VirtualFile;
Expand All @@ -51,6 +52,8 @@
/** {@link AsyncFileListener} for monitoring project changes requiring a re-sync */
public class QuerySyncAsyncFileListener implements AsyncFileListener {

private static final Logger logger = Logger.getInstance(QuerySyncAsyncFileListener.class);

private final Project project;
private final SyncRequester syncRequester;

Expand Down Expand Up @@ -200,6 +203,7 @@ public void afterQuerySync(Project project, BlazeContext context) {

@Override
public void requestSync(@NotNull Collection<VirtualFile> files) {
logger.info(String.format("Putting %d files into sync queue", files.size()));
unprocessedChanges.addAll(files);
if (changePending.compareAndSet(false, true)) {
if (!BlazeSyncStatus.getInstance(project).syncInProgress()) {
Expand All @@ -213,6 +217,7 @@ public void requestSync(@NotNull Collection<VirtualFile> files) {
}

private void requestSyncInternal(ImmutableCollection<VirtualFile> files) {
logger.info(String.format("Requesting sync of %d files", files.size()));
QuerySyncManager.getInstance(project)
.deltaSync(
QuerySyncActionStatsScope.createForFiles(QuerySyncAsyncFileListener.class, null, files),
Expand Down

0 comments on commit b03028f

Please sign in to comment.