Skip to content

Commit c32860a

Browse files
authored
Convert AndroidSdk to use PluginLogger (#8522)
Part of #8369
1 parent 24df93b commit c32860a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/io/flutter/android/AndroidSdk.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import com.intellij.openapi.vfs.LocalFileSystem;
1919
import com.intellij.openapi.vfs.VirtualFile;
2020
import io.flutter.FlutterUtils;
21+
import io.flutter.logging.PluginLogger;
22+
import io.flutter.settings.FlutterSettings;
2123
import org.jetbrains.annotations.NotNull;
2224
import org.jetbrains.annotations.Nullable;
2325

@@ -29,7 +31,7 @@
2931
* A wrapper around an Android SDK on disk.
3032
*/
3133
public class AndroidSdk {
32-
private static final @NotNull Logger LOG = Logger.getInstance(AndroidSdk.class);
34+
private static final @NotNull Logger LOG = PluginLogger.createLogger(AndroidSdk.class);
3335

3436
@Nullable
3537
public static AndroidSdk createFromProject(@NotNull Project project) {
@@ -128,7 +130,11 @@ public void onTextAvailable(@NotNull ProcessEvent event, @NotNull Key outputType
128130
return emulators;
129131
}
130132
catch (ExecutionException | RuntimeException e) {
131-
FlutterUtils.warn(LOG, "Error listing android emulators", e);
133+
if (FlutterSettings.getInstance().isFilePathLoggingEnabled()) {
134+
LOG.warn("Error listing android emulators", e);
135+
} else {
136+
LOG.warn("Error listing android emulators");
137+
}
132138
return Collections.emptyList();
133139
}
134140
}

0 commit comments

Comments
 (0)