public void logResend(
        final int sessionId,
        final int streamId,
        final int termId,
        final int termOffset,
        final int resendLength,
        final String channel)
    {
        final int length = (SIZE_OF_INT * 6) + channel.length();
        final int captureLength = captureLength(length);
        final int encodedLength = encodedLength(captureLength);

        final ManyToOneRingBuffer ringBuffer = this.ringBuffer;
        final int index = ringBuffer.tryClaim(toEventCodeId(RESEND), encodedLength);
        if (index > 0)
        {
            try
            {
                encodeResend(
                    (UnsafeBuffer)ringBuffer.buffer(),
                    index,
                    captureLength,
                    length,
                    sessionId,
                    streamId,
                    termId,
                    termOffset,
                    resendLength,
                    channel);
            }
            finally
            {
                ringBuffer.commit(index);
            }
        }
    }
@Test
    void logResend()
    {
        final int sessionId = 9821374;
        final int streamId = 988234;
        final int termId = 89324;
        final int termOffset = 9862314;
        final int length = 1239;
        final int recordOffset = 64;
        final String channel =
            "aeron:udp?endpoint=localhost:10000|term-length=1m|init-term-id=0|term-id=0|term-offset=0";
        final int captureLength = 6 * SIZE_OF_INT + channel.length();

        logBuffer.putLong(CAPACITY + TAIL_POSITION_OFFSET, recordOffset);
        logger.logResend(sessionId, streamId, termId, termOffset, length, channel);
        verifyLogHeader(
            logBuffer, recordOffset, toEventCodeId(RESEND), captureLength, captureLength);

        final StringBuilder sb = new StringBuilder();
        DriverEventDissector.dissectResend(logBuffer, encodedMsgOffset(recordOffset), sb);

        final String expectedMessagePattern =
            "\\[[0-9]+\\.[0-9]+] DRIVER: RESEND \\[112/112]: sessionId=9821374 streamId=988234 termId=89324 " +
            "termOffset=9862314 length=1239 " +
            "channel=" +
            "aeron:udp\\?endpoint=localhost:10000\\|term-length=1m\\|init-term-id=0\\|term-id=0\\|term-offset=0";

        assertThat(sb.toString(), Matchers.matchesPattern(expectedMessagePattern));
    }