From fa80b118a2620d6cb5ef27d1ca5209bbf5aaaa40 Mon Sep 17 00:00:00 2001 From: Helin Shiah Date: Tue, 8 Jul 2025 08:37:58 -0700 Subject: [PATCH] Change JX Browser file management to plugin logger --- .../src/io/flutter/jxbrowser/JxBrowserManager.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/flutter-idea/src/io/flutter/jxbrowser/JxBrowserManager.java b/flutter-idea/src/io/flutter/jxbrowser/JxBrowserManager.java index 2add4f4ea2..550e4d6b87 100644 --- a/flutter-idea/src/io/flutter/jxbrowser/JxBrowserManager.java +++ b/flutter-idea/src/io/flutter/jxbrowser/JxBrowserManager.java @@ -23,6 +23,7 @@ import com.intellij.util.download.FileDownloader; import com.teamdev.jxbrowser.browser.UnsupportedRenderingModeException; import com.teamdev.jxbrowser.engine.RenderingMode; +import io.flutter.logging.PluginLogger; import io.flutter.settings.FlutterSettings; import io.flutter.utils.FileUtils; import io.flutter.utils.JxBrowserUtils; @@ -81,7 +82,7 @@ else if (Objects.equals(info.getMajorVersion(), "2020")) { @NotNull private static final AtomicBoolean listeningForSetting = new AtomicBoolean(false); @NotNull - private static final Logger LOG = Logger.getInstance(JxBrowserManager.class); + private static final Logger LOG = PluginLogger.createLogger(JxBrowserManager.class); @NotNull public static CompletableFuture installation = new CompletableFuture<>(); @NotNull @@ -261,7 +262,7 @@ public void setUp(@NotNull String projectName) { assert fileName != null; final String filePath = getFilePath(fileName); if (!fileUtils.deleteFile(filePath)) { - LOG.info(projectName + ": Existing file could not be deleted - " + filePath); + LOG.info(projectName + ": Existing file could not be deleted - " + fileName); } } downloadJxBrowser(fileNames); @@ -311,7 +312,7 @@ public void run(@NotNull ProgressIndicator indicator) { ContainerUtil.getFirstItem(downloader.download(new File(DOWNLOAD_PATH))); final File file = download != null ? download.first : null; if (file != null) { - LOG.info(project.getName() + ": JxBrowser file downloaded: " + file.getAbsolutePath()); + LOG.info(project.getName() + ": JxBrowser file downloaded: " + file.getName()); } } @@ -344,11 +345,11 @@ private void loadClasses(@NotNull String @NotNull [] fileNames) { fileUtils.loadPaths(this.getClass().getClassLoader(), paths); } catch (Exception ex) { - LOG.info("Failed to load JxBrowser file", ex); + LOG.info("Failed to load JxBrowser paths"); setStatusFailed(new InstallationFailedReason(FailureType.CLASS_LOAD_FAILED)); return; } - LOG.info("Loaded JxBrowser files successfully: " + paths); + LOG.info("Loaded JxBrowser files successfully"); try { final Class clazz = Class.forName("com.teamdev.jxbrowser.browser.UnsupportedRenderingModeException");