1414import com .intellij .openapi .diagnostic .Logger ;
1515import com .intellij .openapi .util .Key ;
1616import io .flutter .FlutterUtils ;
17+ import io .flutter .logging .PluginLogger ;
1718import io .flutter .settings .FlutterSettings ;
1819import io .flutter .utils .JsonUtils ;
1920import io .flutter .utils .StdoutJsonParser ;
@@ -41,7 +42,7 @@ public class DaemonApi {
4142
4243 private static final int STDERR_LINES_TO_KEEP = 100 ;
4344 private static final Gson GSON = new Gson ();
44- private static final @ NotNull Logger LOG = Logger . getInstance (DaemonApi .class );
45+ private static final @ NotNull Logger LOG = PluginLogger . createLogger (DaemonApi .class );
4546 @ NotNull private final Consumer <String > callback ;
4647 private final AtomicInteger nextId = new AtomicInteger ();
4748 private final Map <Integer , Command > pending = new LinkedHashMap <>();
@@ -202,7 +203,7 @@ private Command takePending(int id) {
202203 cmd = pending .remove (id );
203204 }
204205 if (cmd == null ) {
205- FlutterUtils .warn (LOG , "received a response for a request that wasn't sent: " + id );
206+ LOG .warn ("received a response for a request that wasn't sent: " + id );
206207 return null ;
207208 }
208209 return cmd ;
@@ -287,7 +288,7 @@ public static JsonObject parseAndValidateDaemonEvent(String message) {
287288 private static void sendCommand (String json , ProcessHandler handler ) {
288289 final PrintWriter stdin = getStdin (handler );
289290 if (stdin == null ) {
290- FlutterUtils .warn (LOG , "can't write command to Flutter process: " + json );
291+ LOG .warn ("can't write command to Flutter process because stdin is null : " + json );
291292 return ;
292293 }
293294 stdin .write ('[' );
@@ -299,7 +300,7 @@ private static void sendCommand(String json, ProcessHandler handler) {
299300 }
300301
301302 if (stdin .checkError ()) {
302- FlutterUtils .warn (LOG , "can't write command to Flutter process: " + json );
303+ LOG .warn ("can't write command to Flutter process due to error : " + json );
303304 }
304305 }
305306
@@ -361,7 +362,7 @@ void complete(@Nullable JsonElement result) {
361362 done .complete (parseResult .apply (result ));
362363 }
363364 catch (Exception e ) {
364- FlutterUtils .warn (LOG , "Unable to parse response from Flutter daemon. Command was: " + this , e );
365+ LOG .warn ("Unable to parse response from Flutter daemon. Command was: " + this , e );
365366 done .completeExceptionally (e );
366367 }
367368 }
0 commit comments