@Test public void testNoProgressLogged() { underTest.logProgress(); verify(mockLogger, never()).info(any(Marker.class), anyString(), anyCollection()); }
@VisibleForTesting void logProgress() { if (lastProgressEvent != null) { if (mdcMap != null) { MDC.setContextMap(mdcMap); } Logger logger = Optional.ofNullable(lastProgressEvent.getLogger()).orElse(log); logger.info(INTERNAL_PROGRESS, format(PROGRESS_LINE, lastProgressEvent.getMessage()), lastProgressEvent.getArgumentArray()); lastProgressEvent = null; } }
ProgressTaskLogger implements TaskLogger { @VisibleForTesting void logProgress() { if (lastProgressEvent != null) { if (mdcMap != null) { MDC.setContextMap(mdcMap); } Logger logger = Optional.ofNullable(lastProgressEvent.getLogger()).orElse(log); logger.info(INTERNAL_PROGRESS, format(PROGRESS_LINE, lastProgressEvent.getMessage()), lastProgressEvent.getArgumentArray()); lastProgressEvent = null; } } }
ProgressTaskLogger implements TaskLogger { @VisibleForTesting void logProgress() { if (lastProgressEvent != null) { if (mdcMap != null) { MDC.setContextMap(mdcMap); } Logger logger = Optional.ofNullable(lastProgressEvent.getLogger()).orElse(log); logger.info(INTERNAL_PROGRESS, format(PROGRESS_LINE, lastProgressEvent.getMessage()), lastProgressEvent.getArgumentArray()); lastProgressEvent = null; } } ProgressTaskLogger(final Logger log);   ProgressTaskLogger(final Logger log,
                     final long initialDelay,
                     final long progressInterval,
                     final TimeUnit timeUnit); }
ProgressTaskLogger implements TaskLogger { @VisibleForTesting void logProgress() { if (lastProgressEvent != null) { if (mdcMap != null) { MDC.setContextMap(mdcMap); } Logger logger = Optional.ofNullable(lastProgressEvent.getLogger()).orElse(log); logger.info(INTERNAL_PROGRESS, format(PROGRESS_LINE, lastProgressEvent.getMessage()), lastProgressEvent.getArgumentArray()); lastProgressEvent = null; } } ProgressTaskLogger(final Logger log);   ProgressTaskLogger(final Logger log,
                     final long initialDelay,
                     final long progressInterval,
                     final TimeUnit timeUnit); @Override void start(); @Override void finish(); @Override void progress(final TaskLoggingEvent event); @Override void flush(); static void shutdown(); }
ProgressTaskLogger implements TaskLogger { @VisibleForTesting void logProgress() { if (lastProgressEvent != null) { if (mdcMap != null) { MDC.setContextMap(mdcMap); } Logger logger = Optional.ofNullable(lastProgressEvent.getLogger()).orElse(log); logger.info(INTERNAL_PROGRESS, format(PROGRESS_LINE, lastProgressEvent.getMessage()), lastProgressEvent.getArgumentArray()); lastProgressEvent = null; } } ProgressTaskLogger(final Logger log);   ProgressTaskLogger(final Logger log,
                     final long initialDelay,
                     final long progressInterval,
                     final TimeUnit timeUnit); @Override void start(); @Override void finish(); @Override void progress(final TaskLoggingEvent event); @Override void flush(); static void shutdown();  }