class PrintToLogHandler implements ScannerHandler {
    /** */
    private final IgniteLogger log;

    /** */
    private StringBuilder resultString = new StringBuilder();

    /**
     * @param log Logger.
     */
    public PrintToLogHandler(IgniteLogger log) {
        this.log = log;
    }

    /** {@inheritDoc} */
    @Override public void handle(IgniteBiTuple<WALPointer, WALRecord> record) {
        ensureNotFinished();

        resultString
            .append(DEFAULT_WAL_RECORD_PREFIX)
            .append(toStringRecord(record.get2()))
            .append(System.lineSeparator());
    }

    /** {@inheritDoc} */
    @Override public void finish() {<FILL_FUNCTION_BODY>}

    /**
     *
     */
    private void ensureNotFinished() {
        if (resultString == null)
            throw new IgniteException("This handler has been already finished.");
    }
}

        ensureNotFinished();

        String msg = resultString.toString();

        resultString = null;

        if (log.isInfoEnabled())
            log.info(msg);
    
<no_super_class>