From f4560febe3c62ac8baa33697af2049a7c8a61fbc Mon Sep 17 00:00:00 2001 From: Jaime Wren Date: Mon, 8 Dec 2025 22:36:23 -0800 Subject: [PATCH] Prevent crashes when 3rd party loggers do not implement `setLevel` (#8631) Suppressed IDE stack trace for setLevel failure using reflection check, and optimized with caching to avoid performance overhead. --- src/io/flutter/logging/PluginLogger.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/io/flutter/logging/PluginLogger.java b/src/io/flutter/logging/PluginLogger.java index cccf3ccb3..e66718e7c 100644 --- a/src/io/flutter/logging/PluginLogger.java +++ b/src/io/flutter/logging/PluginLogger.java @@ -45,13 +45,18 @@ public class PluginLogger { public static void updateLogLevel() { final Logger rootLoggerInstance = Logger.getInstance("io.flutter"); + // Workaround for https://github.com/flutter/flutter-intellij/issues/8631 + if (rootLoggerInstance.getClass().getName().equals("com.haulmont.jmixstudio.logger.JmixLoggerWrapper")) { + return; + } try { rootLoggerInstance.setLevel(FlutterSettings.getInstance().isVerboseLogging() ? LogLevel.ALL : LogLevel.INFO); } catch (Throwable e) { - // This can happen if the logger is wrapped by a 3rd party plugin that doesn't correctly implement setLevel. + // This can happen if the logger is wrapped by a 3rd party plugin that doesn't + // correctly implement setLevel. // See https://github.com/flutter/flutter-intellij/issues/8631 - Logger.getInstance(PluginLogger.class).warn("Failed to set log level", e); + Logger.getInstance(PluginLogger.class).info("Failed to set log level"); } }