Skip to content

[logging] Use plugin logger for embedded browser #8370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/io/flutter/jxbrowser/EmbeddedJxBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.teamdev.jxbrowser.view.swing.BrowserView;
import com.teamdev.jxbrowser.view.swing.callback.DefaultAlertCallback;
import com.teamdev.jxbrowser.view.swing.callback.DefaultConfirmCallback;
import io.flutter.logging.PluginLogger;
import io.flutter.settings.FlutterSettings;
import io.flutter.utils.AsyncUtils;
import io.flutter.utils.JxBrowserUtils;
Expand Down Expand Up @@ -122,7 +123,7 @@ public JComponent getTabComponent(ContentManager contentManager) {
}

public class EmbeddedJxBrowser extends EmbeddedBrowser {
private static final @NotNull Logger LOG = Logger.getInstance(JxBrowserManager.class);
private static final @NotNull Logger LOG = PluginLogger.createLogger(JxBrowserManager.class);
private static final String INSTALLATION_IN_PROGRESS_LABEL = "Installing JxBrowser...";
private static final String INSTALLATION_TIMED_OUT_LABEL =
"Waiting for JxBrowser installation timed out. Restart your IDE to try again.";
Expand Down Expand Up @@ -167,7 +168,7 @@ private EmbeddedJxBrowser(@NotNull Project project) {
}

@Override
public Logger logger() {
public @NotNull Logger logger() {
return LOG;
}

Expand Down
2 changes: 1 addition & 1 deletion src/io/flutter/view/EmbeddedBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static public class BrowserTab {

protected final Map<@NotNull String, Map<@NotNull String, @NotNull BrowserTab>> windows = new HashMap<>();

public abstract Logger logger();
public abstract @NotNull Logger logger();

private DevToolsUrl url;

Expand Down
5 changes: 3 additions & 2 deletions src/io/flutter/view/EmbeddedJcefBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.intellij.ui.content.ContentManager;
import com.intellij.ui.jcef.JBCefBrowser;
import io.flutter.jxbrowser.JxBrowserManager;
import io.flutter.logging.PluginLogger;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
Expand Down Expand Up @@ -47,7 +48,7 @@ public JComponent getTabComponent(ContentManager contentManager) {
}

public class EmbeddedJcefBrowser extends EmbeddedBrowser {
private static final @NotNull Logger LOG = Logger.getInstance(JxBrowserManager.class);
private static final @NotNull Logger LOG = PluginLogger.createLogger(JxBrowserManager.class);

public EmbeddedJcefBrowser(Project project) {
super(project);
Expand All @@ -58,7 +59,7 @@ public static EmbeddedJcefBrowser getInstance(@NotNull Project project) {
return Objects.requireNonNull(project.getService(EmbeddedJcefBrowser.class));
}

public Logger logger() {
public @NotNull Logger logger() {
return LOG;
}

Expand Down