Skip to content
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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 88.2.0

### Added

### Changed

### Removed

### Fixed

- Fixed crash when using 3rd party loggers that don't implement `setLevel`. (#8631)

## 88.1.0

### Added
Expand Down
9 changes: 8 additions & 1 deletion src/io/flutter/logging/PluginLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ public class PluginLogger {

public static void updateLogLevel() {
final Logger rootLoggerInstance = Logger.getInstance("io.flutter");
rootLoggerInstance.setLevel(FlutterSettings.getInstance().isVerboseLogging() ? LogLevel.ALL : LogLevel.INFO);
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.
// See https://github.com/flutter/flutter-intellij/issues/8631
Logger.getInstance(PluginLogger.class).warn("Failed to set log level", e);
}
}

public static @NotNull Logger createLogger(@NotNull Class<?> logClass) {
Expand Down
Loading