logger-tools/src/main/java/net/openhft/chronicle/logger/tools/ChronicleLogReader.java
public void processLogs(@NotNull ChronicleLogProcessor processor, boolean waitForIt) {
        ExcerptTailer tailer = cq.createTailer();
        for (; ; ) {
            try (DocumentContext dc = tailer.readingDocument()) {
                Wire wire = dc.wire();
                if (wire == null)
                    if (waitForIt) {
                        try {
                            Thread.sleep(50L);
                        } catch (InterruptedException ignored) {

                        }
                        continue;
                    } else {
                        break;
                    }

                long timestamp = wire.read("ts").int64();
                ChronicleLogLevel level = wire.read("level").asEnum(ChronicleLogLevel.class);
                String threadName = wire.read("threadName").text();
                String loggerName = wire.read("loggerName").text();
                String message = wire.read("message").text();
                Throwable th = wire.hasMore() ? wire.read("throwable").throwable(false) : null;
                List<Object> argsL = new ArrayList<>();
                if (wire.hasMore()) {
                    wire.read("args").sequence(argsL, (l, vi) -> {
                        while (vi.hasNextSequenceItem()) {
                            l.add(vi.object(Object.class));
                        }
                    });
                }
                Object[] args = argsL.toArray(new Object[argsL.size()]);
                processor.process(timestamp, level, threadName, loggerName, message, th, args);
            }
        }
    }
/**
     * Decode logs
     *
     * @param processor user-provided processor called for each log message
     * @param waitForIt whether to wait for more data or stop after EOF reached
     */
Decode logs
@param processor user-provided processor called for each log message
@param waitForIt whether to wait for more data or stop after EOF reached
Decode logs @param processor user - provided processor called for each log message @param waitForIt whether to wait for more data or stop after EOF reached
public void processLogs(@NotNull ChronicleLogProcessor processor, boolean waitForIt) {
        ExcerptTailer tailer = cq.createTailer();
        for (; ; ) {
            try (DocumentContext dc = tailer.readingDocument()) {
                Wire wire = dc.wire();
                if (wire == null)
                    if (waitForIt) {
                        try {
                            Thread.sleep(50L);
                        } catch (InterruptedException ignored) {
                        }
                        continue;
                    } else {
                        break;
                    }
                long timestamp = wire.read("ts").int64();
                ChronicleLogLevel level = wire.read("level").asEnum(ChronicleLogLevel.class);
                String threadName = wire.read("threadName").text();
                String loggerName = wire.read("loggerName").text();
                String message = wire.read("message").text();
                Throwable th = wire.hasMore() ? wire.read("throwable").throwable(false) : null;
                List<Object> argsL = new ArrayList<>();
                if (wire.hasMore()) {
                    wire.read("args").sequence(argsL, (l, vi) -> {
                        while (vi.hasNextSequenceItem()) {
                            l.add(vi.object(Object.class));
                        }
                    });
                }
                Object[] args = argsL.toArray(new Object[argsL.size()]);
                processor.process(timestamp, level, threadName, loggerName, message, th, args);
            }
        }
    }
public void processLogs ( @ NotNull ChronicleLogProcessor processor , boolean waitForIt ) { ExcerptTailer tailer = cq . createTailer ( ) ; for ( ; ; ) { try ( DocumentContext dc = tailer . readingDocument ( ) ) { Wire wire = dc . wire ( ) ; if ( wire == null ) if ( waitForIt ) { try { Thread . sleep ( 50L ) ; } catch ( InterruptedException ignored ) { } continue ; } else { break ; } long timestamp = wire . read ( "ts" ) . int64 ( ) ; ChronicleLogLevel level = wire . read ( "level" ) . asEnum ( ChronicleLogLevel . class ) ; String threadName = wire . read ( "threadName" ) . text ( ) ; String loggerName = wire . read ( "loggerName" ) . text ( ) ; String message = wire . read ( "message" ) . text ( ) ; Throwable th = wire . hasMore ( ) ? wire . read ( "throwable" ) . throwable ( false ) : null ; List < Object > argsL = new ArrayList < > ( ) ; if ( wire . hasMore ( ) ) { wire . read ( "args" ) . sequence ( argsL , ( l , vi ) -> { while ( vi . hasNextSequenceItem ( ) ) { l . add ( vi . object ( Object . class ) ) ; } } ) ; } Object [ ] args = argsL . toArray ( new Object [ argsL . size ( ) ] ) ; processor . process ( timestamp , level , threadName , loggerName , message , th , args ) ; } } }
Decode logs
 @param processor user-provided processor called for each log message
 @param waitForIt whether to wait for more data or stop after EOF reached
Decode logs @param processor user - provided processor called for each log message @param waitForIt whether to wait for more data or stop after EOF reached