@@ -0,0 +1,3124 @@
+package stroom.util.logging;%0A%0Aimport org.junit.jupiter.api.Test;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.time.Duration;%0Aimport java.time.Instant;%0Aimport java.time.ZoneOffset;%0Aimport java.util.stream.Stream;%0A%0Aimport static org.junit.jupiter.api.Assertions.*;%0A%0Aclass TestLambdaLogger %7B%0A%0A    private static final Logger LOGGER = LoggerFactory.getLogger(TestLambdaLogger.class);%0A    private static final LambdaLogger LAMBDA_LOGGER = LambdaLoggerFactory.getLogger(TestLambdaLogger.class);%0A%0A    @Test%0A    void compareLambdaToIfBlock() %7B%0A%0A        String someStr = %22sdskjdsdsdk%22;%0A%0A        Stream.of(100, 1_000, 1_000_000, 100_000_000)%0A                .forEach(iterations -%3E %7B%0A%0A            LOGGER.info(%22Iterations: %7B%7D%22, iterations);%0A%0A            final Instant lambdaLoggerStartTime = Instant.now();%0A            for (int i = 0; i %3C iterations; i++) %7B%0A                // Use a complex msg%0A                LAMBDA_LOGGER.trace(() -%3E LogUtil.message(%22This is my msg %7B%7D %7B%7D%22,%0A                        iterations, lambdaLoggerStartTime.atOffset(ZoneOffset.MIN)));%0A%0A                LAMBDA_LOGGER.trace(() -%3E LogUtil.message(%22This is another msg %7B%7D %7B%7D %7B%7D%22,%0A                        someStr, iterations, lambdaLoggerStartTime.atOffset(ZoneOffset.MIN)));%0A%0A                LAMBDA_LOGGER.trace(() -%3E LogUtil.message(%22This is yet another msg %7B%7D%22,%0A                        iterations));%0A            %7D%0A            final Duration lambdaLoggerDuration = Duration.between(lambdaLoggerStartTime, Instant.now());%0A%0A            LOGGER.info(%22Duration for LAMBDA_LOGGER trace(() -%3E LogUtil.message(...)) %7B%7D (%7B%7Dms)%22,%0A                    lambdaLoggerDuration, lambdaLoggerDuration.toMillis());%0A%0A            final Instant loggerStartTime = Instant.now();%0A%0A            for (int i = 0; i %3C iterations; i++) %7B%0A                // Use a complex msg%0A                if (LOGGER.isTraceEnabled()) %7B%0A                    LOGGER.trace(LogUtil.message(%22This is my msg %7B%7D %7B%7D%22,%0A                            iterations, loggerStartTime.atOffset(ZoneOffset.MIN)));%0A                %7D%0A                if (LOGGER.isTraceEnabled()) %7B%0A                    LOGGER.trace(LogUtil.message(%22This is another msg %7B%7D %7B%7D %7B%7D%22,%0A                            someStr, iterations, loggerStartTime.atOffset(ZoneOffset.MIN)));%0A                %7D%0A                if (LOGGER.isTraceEnabled()) %7B%0A                    LOGGER.trace(LogUtil.message(%22This is yet another my msg %7B%7D%22,%0A                            iterations));%0A                %7D%0A            %7D%0A            final Duration loggerDuration = Duration.between(loggerStartTime, Instant.now());%0A%0A            LOGGER.info(%22Duration for LOGGER if (LOGGER.isTraceEnabled()) %7B%7D (%7B%7Dms)%22,%0A                    loggerDuration, loggerDuration.toMillis());%0A%0A            LOGGER.info(%22ms diff %7B%7D%22, lambdaLoggerDuration.toMillis() - loggerDuration.toMillis());%0A            LOGGER.info(%22%25  diff %7B%7D%22,%0A                    (lambdaLoggerDuration.toMillis() - loggerDuration.toMillis())%0A                            / (double) loggerDuration.toMillis() * 100);%0A            %0A            LOGGER.info(%22---------------------------%22);%0A        %7D);%0A    %7D%0A%7D

Add TestLambdaLogger