Skip to content

Commit d5ef4c9

Browse files
authored
Suppress IDE stack trace for setLevel failure (#8639)
The stack trace is effectively just the log message being excessively loud because of how IntelliJ handles exceptions passed to the logger. This is a follow up on #8631
1 parent 192ef96 commit d5ef4c9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/io/flutter/logging/PluginLogger.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,18 @@ public class PluginLogger {
4545

4646
public static void updateLogLevel() {
4747
final Logger rootLoggerInstance = Logger.getInstance("io.flutter");
48+
// Workaround for https://github.com/flutter/flutter-intellij/issues/8631
49+
if (rootLoggerInstance.getClass().getName().equals("com.haulmont.jmixstudio.logger.JmixLoggerWrapper")) {
50+
return;
51+
}
4852
try {
4953
rootLoggerInstance.setLevel(FlutterSettings.getInstance().isVerboseLogging() ? LogLevel.ALL : LogLevel.INFO);
5054
}
5155
catch (Throwable e) {
52-
// This can happen if the logger is wrapped by a 3rd party plugin that doesn't correctly implement setLevel.
56+
// This can happen if the logger is wrapped by a 3rd party plugin that doesn't
57+
// correctly implement setLevel.
5358
// See https://github.com/flutter/flutter-intellij/issues/8631
54-
Logger.getInstance(PluginLogger.class).warn("Failed to set log level", e);
59+
Logger.getInstance(PluginLogger.class).info("Failed to set log level");
5560
}
5661
}
5762

0 commit comments

Comments
 (0)