@Test public void testMarkLog_EmitEvent() { logMarker.markLog("test"); ArgumentCaptor<LogMarkInsertedEvent> argCaptor = ArgumentCaptor.forClass(LogMarkInsertedEvent.class); verify(eventManager).post(argCaptor.capture()); assertThat(argCaptor.getValue().getMessage(), is("test")); }
@Override public void markLog(final String message) { LoggerLevel loggerLevel = logManager.getLoggerEffectiveLevel(log.getName()); if (LoggerLevel.INFO.compareTo(loggerLevel) < 0) { logManager.setLoggerLevel(log.getName(), LoggerLevel.INFO); } String asterixes = Strings.repeat("*", message.length() + 4); log.info("\n{}\n* {} *\n{}", asterixes, message, asterixes); eventManager.post(new LogMarkInsertedEvent(message)); }
LogMarkerImpl extends ComponentSupport implements LogMarker { @Override public void markLog(final String message) { LoggerLevel loggerLevel = logManager.getLoggerEffectiveLevel(log.getName()); if (LoggerLevel.INFO.compareTo(loggerLevel) < 0) { logManager.setLoggerLevel(log.getName(), LoggerLevel.INFO); } String asterixes = Strings.repeat("*", message.length() + 4); log.info("\n{}\n* {} *\n{}", asterixes, message, asterixes); eventManager.post(new LogMarkInsertedEvent(message)); } }
LogMarkerImpl extends ComponentSupport implements LogMarker { @Override public void markLog(final String message) { LoggerLevel loggerLevel = logManager.getLoggerEffectiveLevel(log.getName()); if (LoggerLevel.INFO.compareTo(loggerLevel) < 0) { logManager.setLoggerLevel(log.getName(), LoggerLevel.INFO); } String asterixes = Strings.repeat("*", message.length() + 4); log.info("\n{}\n* {} *\n{}", asterixes, message, asterixes); eventManager.post(new LogMarkInsertedEvent(message)); } @Inject  LogMarkerImpl(final LogManager logManager, final EventManager eventManager); }
LogMarkerImpl extends ComponentSupport implements LogMarker { @Override public void markLog(final String message) { LoggerLevel loggerLevel = logManager.getLoggerEffectiveLevel(log.getName()); if (LoggerLevel.INFO.compareTo(loggerLevel) < 0) { logManager.setLoggerLevel(log.getName(), LoggerLevel.INFO); } String asterixes = Strings.repeat("*", message.length() + 4); log.info("\n{}\n* {} *\n{}", asterixes, message, asterixes); eventManager.post(new LogMarkInsertedEvent(message)); } @Inject  LogMarkerImpl(final LogManager logManager, final EventManager eventManager); @Override void markLog(final String message); }
LogMarkerImpl extends ComponentSupport implements LogMarker { @Override public void markLog(final String message) { LoggerLevel loggerLevel = logManager.getLoggerEffectiveLevel(log.getName()); if (LoggerLevel.INFO.compareTo(loggerLevel) < 0) { logManager.setLoggerLevel(log.getName(), LoggerLevel.INFO); } String asterixes = Strings.repeat("*", message.length() + 4); log.info("\n{}\n* {} *\n{}", asterixes, message, asterixes); eventManager.post(new LogMarkInsertedEvent(message)); } @Inject  LogMarkerImpl(final LogManager logManager, final EventManager eventManager); @Override void markLog(final String message);  }