static void handle(@NotNull IdeaLoggingEvent event) {
    if (ourLoggerBroken) return;

    try {
      var kind = getOOMErrorKind(event.getThrowable());
      if (kind != null) {
        ourOomOccurred = true;
        LowMemoryNotifier.showNotification(kind, true);
      }
      else if (!ourOomOccurred) {
        MessagePool.getInstance().addIdeFatalMessage(event);
      }
    }
    catch (Throwable e) {
      var message = e.getMessage();
      //noinspection InstanceofCatchParameter
      if (message != null && message.contains("Could not initialize class com.intellij.diagnostic.MessagePool") ||
          e instanceof NullPointerException && ApplicationManager.getApplication() == null) {
        ourLoggerBroken = true;
      }
    }
  }
static void handle(@NotNull IdeaLoggingEvent event)