use of com.intellij.openapi.diagnostic.ErrorLogger in project intellij-community by JetBrains.
the class DialogAppender method appendToLoggers.
void appendToLoggers(@NotNull LoggingEvent event, @NotNull ErrorLogger[] errorLoggers) {
if (myDialogRunnable != null) {
return;
}
final IdeaLoggingEvent ideaEvent;
final Object message = event.getMessage();
if (message instanceof IdeaLoggingEvent) {
ideaEvent = (IdeaLoggingEvent) message;
} else {
ThrowableInformation info = event.getThrowableInformation();
if (info == null) {
return;
}
ideaEvent = extractLoggingEvent(message, info.getThrowable());
}
for (int i = errorLoggers.length - 1; i >= 0; i--) {
final ErrorLogger logger = errorLoggers[i];
if (!logger.canHandle(ideaEvent)) {
continue;
}
myDialogRunnable = () -> {
try {
logger.handle(ideaEvent);
} finally {
myDialogRunnable = null;
}
};
final Application app = ApplicationManager.getApplication();
if (app == null) {
new Thread(myDialogRunnable, "dialog appender logger").start();
} else {
app.executeOnPooledThread(myDialogRunnable);
}
break;
}
}
Aggregations