class FormattedLogcatReceiver implements AndroidLogcatService.LogcatListener {

  @Override
  public final void onLogLineReceived(@NotNull LogCatMessage line) {
    LogCatHeader header = line.getHeader();

    // We want the if branch whenever logcat prints a header, even if it has the same value as the previous one. Check the reference values
    // (with !=) and not the object values (with equals) here because we get a new instance every time logcat prints a header.
    if (myActiveHeader != header) {
      myActiveHeader = header;
      receiveFormattedLogLine(myFormatter.formatMessageFull(header, line.getMessage()));
    }
    else {
      String message = AndroidLogcatFormatter.formatContinuation(line.getMessage());
      receiveFormattedLogLine(message);
    }
  }

    FormattedLogcatReceiver(@NotNull AndroidLogcatFormatter formatter);

}