1212import com .teamdev .jxbrowser .engine .Engine ;
1313import com .teamdev .jxbrowser .engine .EngineOptions ;
1414import com .teamdev .jxbrowser .engine .PasswordStore ;
15+ import io .flutter .logging .PluginLogger ;
16+ import io .flutter .settings .FlutterSettings ;
1517import org .jetbrains .annotations .NotNull ;
1618
1719import java .io .File ;
2123import static com .teamdev .jxbrowser .engine .RenderingMode .OFF_SCREEN ;
2224
2325public class EmbeddedBrowserEngine {
24- private static final @ NotNull Logger LOG = Logger . getInstance (EmbeddedBrowserEngine .class );
26+ private static final @ NotNull Logger LOG = PluginLogger . createLogger (EmbeddedBrowserEngine .class );
2527 private final Engine engine ;
2628
2729 public static EmbeddedBrowserEngine getInstance () {
@@ -30,7 +32,7 @@ public static EmbeddedBrowserEngine getInstance() {
3032
3133 public EmbeddedBrowserEngine () {
3234 final String dataPath = JxBrowserManager .DOWNLOAD_PATH + File .separatorChar + "user-data" ;
33- LOG .info ("JxBrowser user data path: " + dataPath );
35+ if ( FlutterSettings . getInstance (). isFilePathLoggingEnabled ()) LOG .info ("JxBrowser user data path: " + dataPath );
3436
3537 final EngineOptions .Builder optionsBuilder =
3638 EngineOptions .newBuilder (SystemInfo .isMac ? HARDWARE_ACCELERATED : OFF_SCREEN )
@@ -50,7 +52,11 @@ public EmbeddedBrowserEngine() {
5052 }
5153 catch (Exception ex ) {
5254 temp = null ;
53- LOG .info (ex );
55+ if (FlutterSettings .getInstance ().isFilePathLoggingEnabled ()) {
56+ LOG .info (ex );
57+ } else {
58+ LOG .info ("Exception when creating a new instance of JX Browser engine: " + ex .getMessage ());
59+ }
5460 }
5561 engine = temp ;
5662
@@ -63,7 +69,11 @@ public boolean canExitApplication() {
6369 }
6470 }
6571 catch (Exception ex ) {
66- LOG .info (ex );
72+ if (FlutterSettings .getInstance ().isFilePathLoggingEnabled ()) {
73+ LOG .info (ex );
74+ } else {
75+ LOG .info ("Exception when closing JX Browser engine: " + ex .getMessage ());
76+ }
6777 }
6878 return true ;
6979 }
0 commit comments