@Test public void testLogWithLocationWithTag() { final LocationAwareLogger log = mock(LocationAwareLogger.class); final Slf4jLogTarget target = new Slf4jLogTarget(log); final Exception exception = new Exception("test exception"); target.log(LogLevel.TRACE, "tag", "format %s", 1, new Object[] {"arg"}, exception, Zlg.entrypoint); final Marker marker = MarkerFactory.getMarker("tag"); verify(log).log(eq(marker), eq(Zlg.entrypoint), eq(LocationAwareLogger.TRACE_INT), eq("format arg"), eq(new Object[0]), eq(exception)); }
@Override public void log(int level, String tag, String format, int argc, Object[] argv, Throwable throwable, String entrypoint) { if (isLocationAware) { logWithLocation(level, tag, format, argc, argv, throwable, entrypoint); } else { logDirect(level, tag, format, argc, argv, throwable); } }
Slf4jLogTarget implements LogTarget { @Override public void log(int level, String tag, String format, int argc, Object[] argv, Throwable throwable, String entrypoint) { if (isLocationAware) { logWithLocation(level, tag, format, argc, argv, throwable, entrypoint); } else { logDirect(level, tag, format, argc, argv, throwable); } } }
Slf4jLogTarget implements LogTarget { @Override public void log(int level, String tag, String format, int argc, Object[] argv, Throwable throwable, String entrypoint) { if (isLocationAware) { logWithLocation(level, tag, format, argc, argv, throwable, entrypoint); } else { logDirect(level, tag, format, argc, argv, throwable); } } Slf4jLogTarget(Logger log); }
Slf4jLogTarget implements LogTarget { @Override public void log(int level, String tag, String format, int argc, Object[] argv, Throwable throwable, String entrypoint) { if (isLocationAware) { logWithLocation(level, tag, format, argc, argv, throwable, entrypoint); } else { logDirect(level, tag, format, argc, argv, throwable); } } Slf4jLogTarget(Logger log); @Override boolean isEnabled(int level); @Override void log(int level, String tag, String format, int argc, Object[] argv, Throwable throwable, String entrypoint); }
Slf4jLogTarget implements LogTarget { @Override public void log(int level, String tag, String format, int argc, Object[] argv, Throwable throwable, String entrypoint) { if (isLocationAware) { logWithLocation(level, tag, format, argc, argv, throwable, entrypoint); } else { logDirect(level, tag, format, argc, argv, throwable); } } Slf4jLogTarget(Logger log); @Override boolean isEnabled(int level); @Override void log(int level, String tag, String format, int argc, Object[] argv, Throwable throwable, String entrypoint);  }