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
6 changes: 3 additions & 3 deletions src/io/flutter/utils/FileWatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.intellij.openapi.vfs.newvfs.BulkFileListener;
import com.intellij.openapi.vfs.newvfs.events.VFileEvent;
import com.intellij.util.messages.MessageBusConnection;
import io.flutter.FlutterUtils;
import io.flutter.logging.PluginLogger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -131,7 +131,7 @@ private void fireEvent() {
callback.run();
}
catch (Exception e) {
FlutterUtils.warn(LOG, "Uncaught exception in FileWatch callback", e);
LOG.warn("Uncaught exception in FileWatch callback", e);
unsubscribe(); // avoid further errors
}
}
Expand Down Expand Up @@ -269,5 +269,5 @@ public void after(@NotNull List<? extends VFileEvent> events) {
}
}

private static final @NotNull Logger LOG = Logger.getInstance(FileWatch.class);
private static final @NotNull Logger LOG = PluginLogger.createLogger(FileWatch.class);
}
3 changes: 2 additions & 1 deletion src/io/flutter/utils/IconPreviewGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.TripleFunction;
import io.flutter.FlutterUtils;
import io.flutter.logging.PluginLogger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand All @@ -24,7 +25,7 @@

@SuppressWarnings("UseJBColor")
public class IconPreviewGenerator {
private static final @NotNull Logger LOG = Logger.getInstance(IconPreviewGenerator.class);
private static final @NotNull Logger LOG = PluginLogger.createLogger(IconPreviewGenerator.class);

@NotNull final String fontFilePath;
int iconSize = 16;
Expand Down
19 changes: 10 additions & 9 deletions src/io/flutter/utils/Refreshable.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.intellij.openapi.util.Disposer;
import com.intellij.util.concurrency.AppExecutorUtil;
import io.flutter.FlutterUtils;
import io.flutter.logging.PluginLogger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -122,7 +123,7 @@ T getWhenReady() {
refreshDone.get();
}
catch (Exception e) {
FlutterUtils.warn(LOG, "Unexpected exception waiting for refresh task to finish", e);
FlutterUtils.warn(LOG, "Unexpected exception waiting for refresh task to finish", e, true);
}
return getNow();
}
Expand Down Expand Up @@ -167,7 +168,7 @@ public void refresh(@NotNull Callable<T> callback) {
*/
public void refresh(@NotNull Callback<T> callback) {
if (publisher.isClosing()) {
FlutterUtils.warn(LOG, "attempted to update closed Refreshable");
LOG.warn("attempted to update closed Refreshable");
return;
}
schedule.reschedule(new Request<>(this, callback));
Expand Down Expand Up @@ -228,7 +229,7 @@ private void runInBackground() {
}
catch (Exception e) {
if (!Objects.equal(e.getMessage(), "expected failure in test")) {
FlutterUtils.warn(LOG, "Callback threw an exception while updating a Refreshable", e);
FlutterUtils.warn(LOG, "Callback threw an exception while updating a Refreshable", e, true);
}
}
finally {
Expand All @@ -247,7 +248,7 @@ private void runInBackground() {
});
}
catch (Exception e) {
FlutterUtils.warn(LOG, "Unable to publish a value while updating a Refreshable", e);
FlutterUtils.warn(LOG, "Unable to publish a value while updating a Refreshable", e, true);
}
}
}
Expand All @@ -257,7 +258,7 @@ private void runInBackground() {
}
}

private static final @NotNull Logger LOG = Logger.getInstance(Refreshable.class);
private static final @NotNull Logger LOG = PluginLogger.createLogger(Refreshable.class);

/**
* A value indicating whether the Refreshable is being updated or not.
Expand Down Expand Up @@ -520,7 +521,7 @@ void unpublish(@Nullable T discarded) {
unpublishCallback.accept(discarded);
}
catch (Exception e) {
FlutterUtils.warn(LOG, "An unpublish callback threw an exception while updating a Refreshable", e);
FlutterUtils.warn(LOG, "An unpublish callback threw an exception while updating a Refreshable", e, true);
}
}

Expand All @@ -534,7 +535,7 @@ void setState(State newState) {
SwingUtilities.invokeAndWait(() -> doSetState(newState));
}
catch (Exception e) {
FlutterUtils.warn(LOG, "Unable to change state of Refreshable", e);
FlutterUtils.warn(LOG, "Unable to change state of Refreshable", e, true);
}
}

Expand All @@ -552,7 +553,7 @@ private void fireEvent() {
}
catch (Exception e) {
if (!Objects.equal(e.getMessage(), "expected failure in test")) {
FlutterUtils.warn(LOG, "A subscriber to a Refreshable threw an exception", e);
FlutterUtils.warn(LOG, "A subscriber to a Refreshable threw an exception", e, true);
}
}
}
Expand All @@ -569,7 +570,7 @@ void waitForFirstValue() {
initialized.get();
}
catch (Exception e) {
FlutterUtils.warn(LOG, "Unexpected exception waiting for Refreshable to initialize", e);
FlutterUtils.warn(LOG, "Unexpected exception waiting for Refreshable to initialize", e, true);
}
}

Expand Down