private static void applyVfsLogPreferences() {
    Path cacheDir = FSRecords.getCacheDir();
    if (!Files.exists(cacheDir)) {
      return;
    }

    PersistentFSPaths fsRecordsPaths = new PersistentFSPaths(cacheDir);
    Path vfsLogPath = fsRecordsPaths.getVfsLogStorage();
    if (!VfsLog.isVfsTrackingEnabled()) {
      // forcefully erase VfsLog storages if the feature is disabled so that when it will be enabled again we won't consider old data as a source for recovery
      try {
        if (VfsLogImpl.clearStorage(vfsLogPath)) {
          LOG.info("VfsLog data was cleared because VFS operations logging was turned off");
        }
      }
      catch (Throwable e) {
        LOG.error("failed to clear VfsLog storage", e);
      }
    }
    else {
      if (!vfsLogPath.toFile().exists()) {
        // existing vfs must be cleared if vfslog directory does not exist, otherwise, vfslog will lack crucial data for recovery
        Path corruptionMarker = fsRecordsPaths.getCorruptionMarkerFile();
        if (!corruptionMarker.toFile().exists()) {
          PersistentFSConnection.scheduleVFSRebuild(corruptionMarker, "VfsLog: VFS operations tracking was enabled", null);
        }
      }
    }
  }
private static void applyVfsLogPreferences()