1414import com .intellij .openapi .util .Disposer ;
1515import com .intellij .util .concurrency .AppExecutorUtil ;
1616import io .flutter .FlutterUtils ;
17+ import io .flutter .logging .PluginLogger ;
1718import org .jetbrains .annotations .NotNull ;
1819import org .jetbrains .annotations .Nullable ;
1920
@@ -122,7 +123,7 @@ T getWhenReady() {
122123 refreshDone .get ();
123124 }
124125 catch (Exception e ) {
125- FlutterUtils .warn (LOG , "Unexpected exception waiting for refresh task to finish" , e );
126+ FlutterUtils .warn (LOG , "Unexpected exception waiting for refresh task to finish" , e , true );
126127 }
127128 return getNow ();
128129 }
@@ -167,7 +168,7 @@ public void refresh(@NotNull Callable<T> callback) {
167168 */
168169 public void refresh (@ NotNull Callback <T > callback ) {
169170 if (publisher .isClosing ()) {
170- FlutterUtils .warn (LOG , "attempted to update closed Refreshable" );
171+ LOG .warn ("attempted to update closed Refreshable" );
171172 return ;
172173 }
173174 schedule .reschedule (new Request <>(this , callback ));
@@ -228,7 +229,7 @@ private void runInBackground() {
228229 }
229230 catch (Exception e ) {
230231 if (!Objects .equal (e .getMessage (), "expected failure in test" )) {
231- FlutterUtils .warn (LOG , "Callback threw an exception while updating a Refreshable" , e );
232+ FlutterUtils .warn (LOG , "Callback threw an exception while updating a Refreshable" , e , true );
232233 }
233234 }
234235 finally {
@@ -247,7 +248,7 @@ private void runInBackground() {
247248 });
248249 }
249250 catch (Exception e ) {
250- FlutterUtils .warn (LOG , "Unable to publish a value while updating a Refreshable" , e );
251+ FlutterUtils .warn (LOG , "Unable to publish a value while updating a Refreshable" , e , true );
251252 }
252253 }
253254 }
@@ -257,7 +258,7 @@ private void runInBackground() {
257258 }
258259 }
259260
260- private static final @ NotNull Logger LOG = Logger . getInstance (Refreshable .class );
261+ private static final @ NotNull Logger LOG = PluginLogger . createLogger (Refreshable .class );
261262
262263 /**
263264 * A value indicating whether the Refreshable is being updated or not.
@@ -520,7 +521,7 @@ void unpublish(@Nullable T discarded) {
520521 unpublishCallback .accept (discarded );
521522 }
522523 catch (Exception e ) {
523- FlutterUtils .warn (LOG , "An unpublish callback threw an exception while updating a Refreshable" , e );
524+ FlutterUtils .warn (LOG , "An unpublish callback threw an exception while updating a Refreshable" , e , true );
524525 }
525526 }
526527
@@ -534,7 +535,7 @@ void setState(State newState) {
534535 SwingUtilities .invokeAndWait (() -> doSetState (newState ));
535536 }
536537 catch (Exception e ) {
537- FlutterUtils .warn (LOG , "Unable to change state of Refreshable" , e );
538+ FlutterUtils .warn (LOG , "Unable to change state of Refreshable" , e , true );
538539 }
539540 }
540541
@@ -552,7 +553,7 @@ private void fireEvent() {
552553 }
553554 catch (Exception e ) {
554555 if (!Objects .equal (e .getMessage (), "expected failure in test" )) {
555- FlutterUtils .warn (LOG , "A subscriber to a Refreshable threw an exception" , e );
556+ FlutterUtils .warn (LOG , "A subscriber to a Refreshable threw an exception" , e , true );
556557 }
557558 }
558559 }
@@ -569,7 +570,7 @@ void waitForFirstValue() {
569570 initialized .get ();
570571 }
571572 catch (Exception e ) {
572- FlutterUtils .warn (LOG , "Unexpected exception waiting for Refreshable to initialize" , e );
573+ FlutterUtils .warn (LOG , "Unexpected exception waiting for Refreshable to initialize" , e , true );
573574 }
574575 }
575576
0 commit comments