TinylogLogger extends Logger { @Override public void log(final Level level, final Object message) { provider.log(STACKTRACE_DEPTH, null, translateLevel(level), null, null, message, (Object[]) null); } TinylogLogger(final String name); @Override boolean isEnabled(final Level level); @Override boolean isTraceEnabled(); @Override void trace(final Object message); @Override void trace(final Object message, final Throwable exception); @Override void trace(final String loggerClassName, final Object message, final Throwable exception); @Override void trace(final String loggerClassName, final Object message, final Object[] arguments, final Throwable exception); @Override void tracev(final String message, final Object... arguments); @Override void tracev(final String message, final Object argument); @Override void tracev(final String message, final Object firstArgument, final Object secondArgument); @Override void tracev(final String message, final Object firstArgument, final Object secondArgument, final Object thirdArgument); @Override void tracev(final Throwable exception, final String message, final Object... arguments); @Override void tracev(final Throwable exception, final String message, final Object argument); @Override void tracev(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument); @Override void tracev(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void tracef(final String message, final Object... arguments); @Override void tracef(final String message, final Object argument); @Override void tracef(final String message, final Object firstArgument, final Object secondArgument); @Override void tracef(final String message, final Object firstArgument, final Object secondArgument, final Object thirdArgument); @Override void tracef(final Throwable exception, final String message, final Object... arguments); @Override void tracef(final Throwable exception, final String message, final Object argument); @Override void tracef(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument); @Override void tracef(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void tracef(final String message, final int argument); @Override void tracef(final String message, final int firstArgument, final int secondArgument); @Override void tracef(final String message, final int firstArgument, final Object secondArgument); @Override void tracef(final String message, final int firstArgument, final int secondArgument, final int thirdArgument); @Override void tracef(final String message, final int firstArgument, final int secondArgument, final Object thirdArgument); @Override void tracef(final String message, final int firstArgument, final Object secondArgument, final Object thirdArgument); @Override void tracef(final Throwable exception, final String message, final int argument); @Override void tracef(final Throwable exception, final String message, final int firstArgument, final int secondArgument); @Override void tracef(final Throwable exception, final String message, final int firstArgument, final Object secondArgument); @Override void tracef(final Throwable exception, final String message, final int firstArgument, final int secondArgument,
		final int thirdArgument); @Override void tracef(final Throwable exception, final String message, final int firstArgument, final int secondArgument,
		final Object thirdArgument); @Override void tracef(final Throwable exception, final String message, final int firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void tracef(final String message, final long argument); @Override void tracef(final String message, final long firstArgument, final long secondArgument); @Override void tracef(final String message, final long firstArgument, final Object secondArgument); @Override void tracef(final String message, final long firstArgument, final long secondArgument, final long thirdArgument); @Override void tracef(final String message, final long firstArgument, final long secondArgument, final Object thirdArgument); @Override void tracef(final String message, final long firstArgument, final Object secondArgument, final Object thirdArgument); @Override void tracef(final Throwable exception, final String message, final long argument); @Override void tracef(final Throwable exception, final String message, final long firstArgument, final long secondArgument); @Override void tracef(final Throwable exception, final String message, final long firstArgument, final Object secondArgument); @Override void tracef(final Throwable exception, final String message, final long firstArgument, final long secondArgument,
		final long thirdArgument); @Override void tracef(final Throwable exception, final String message, final long firstArgument, final long secondArgument,
		final Object thirdArgument); @Override void tracef(final Throwable exception, final String message, final long firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override boolean isDebugEnabled(); @Override void debug(final Object message); @Override void debug(final Object message, final Throwable exception); @Override void debug(final String loggerClassName, final Object message, final Throwable exception); @Override void debug(final String loggerClassName, final Object message, final Object[] arguments, final Throwable exception); @Override void debugv(final String message, final Object... arguments); @Override void debugv(final String message, final Object argument); @Override void debugv(final String message, final Object firstArgument, final Object secondArgument); @Override void debugv(final String message, final Object firstArgument, final Object secondArgument, final Object thirdArgument); @Override void debugv(final Throwable exception, final String message, final Object... arguments); @Override void debugv(final Throwable exception, final String message, final Object argument); @Override void debugv(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument); @Override void debugv(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void debugf(final String message, final Object... arguments); @Override void debugf(final String message, final Object argument); @Override void debugf(final String message, final Object firstArgument, final Object secondArgument); @Override void debugf(final String message, final Object firstArgument, final Object secondArgument, final Object thirdArgument); @Override void debugf(final Throwable exception, final String message, final Object... arguments); @Override void debugf(final Throwable exception, final String message, final Object argument); @Override void debugf(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument); @Override void debugf(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void debugf(final String message, final int argument); @Override void debugf(final String message, final int firstArgument, final int secondArgument); @Override void debugf(final String message, final int firstArgument, final Object secondArgument); @Override void debugf(final String message, final int firstArgument, final int secondArgument, final int thirdArgument); @Override void debugf(final String message, final int firstArgument, final int secondArgument, final Object thirdArgument); @Override void debugf(final String message, final int firstArgument, final Object secondArgument, final Object thirdArgument); @Override void debugf(final Throwable exception, final String message, final int argument); @Override void debugf(final Throwable exception, final String message, final int firstArgument, final int secondArgument); @Override void debugf(final Throwable exception, final String message, final int firstArgument, final Object secondArgument); @Override void debugf(final Throwable exception, final String message, final int firstArgument, final int secondArgument,
		final int thirdArgument); @Override void debugf(final Throwable exception, final String message, final int firstArgument, final int secondArgument,
		final Object thirdArgument); @Override void debugf(final Throwable exception, final String message, final int firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void debugf(final String message, final long argument); @Override void debugf(final String message, final long firstArgument, final long secondArgument); @Override void debugf(final String message, final long firstArgument, final Object secondArgument); @Override void debugf(final String message, final long firstArgument, final long secondArgument, final long thirdArgument); @Override void debugf(final String message, final long firstArgument, final long secondArgument, final Object thirdArgument); @Override void debugf(final String message, final long firstArgument, final Object secondArgument, final Object thirdArgument); @Override void debugf(final Throwable exception, final String message, final long argument); @Override void debugf(final Throwable exception, final String message, final long firstArgument, final long secondArgument); @Override void debugf(final Throwable exception, final String message, final long firstArgument, final Object secondArgument); @Override void debugf(final Throwable exception, final String message, final long firstArgument, final long secondArgument,
		final long thirdArgument); @Override void debugf(final Throwable exception, final String message, final long firstArgument, final long secondArgument,
		final Object thirdArgument); @Override void debugf(final Throwable exception, final String message, final long firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override boolean isInfoEnabled(); @Override void info(final Object message); @Override void info(final Object message, final Throwable exception); @Override void info(final String loggerClassName, final Object message, final Throwable exception); @Override void info(final String loggerClassName, final Object message, final Object[] arguments, final Throwable exception); @Override void infov(final String message, final Object... arguments); @Override void infov(final String message, final Object argument); @Override void infov(final String message, final Object firstArgument, final Object secondArgument); @Override void infov(final String message, final Object firstArgument, final Object secondArgument, final Object thirdArgument); @Override void infov(final Throwable exception, final String message, final Object... arguments); @Override void infov(final Throwable exception, final String message, final Object argument); @Override void infov(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument); @Override void infov(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void infof(final String message, final Object... arguments); @Override void infof(final String message, final Object argument); @Override void infof(final String message, final Object firstArgument, final Object secondArgument); @Override void infof(final String message, final Object firstArgument, final Object secondArgument, final Object thirdArgument); @Override void infof(final Throwable exception, final String message, final Object... arguments); @Override void infof(final Throwable exception, final String message, final Object argument); @Override void infof(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument); @Override void infof(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void warn(final Object message); @Override void warn(final Object message, final Throwable exception); @Override void warn(final String loggerClassName, final Object message, final Throwable exception); @Override void warn(final String loggerClassName, final Object message, final Object[] arguments, final Throwable exception); @Override void warnv(final String message, final Object... arguments); @Override void warnv(final String message, final Object argument); @Override void warnv(final String message, final Object firstArgument, final Object secondArgument); @Override void warnv(final String message, final Object firstArgument, final Object secondArgument, final Object thirdArgument); @Override void warnv(final Throwable exception, final String message, final Object... arguments); @Override void warnv(final Throwable exception, final String message, final Object argument); @Override void warnv(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument); @Override void warnv(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void warnf(final String message, final Object... arguments); @Override void warnf(final String message, final Object argument); @Override void warnf(final String message, final Object firstArgument, final Object secondArgument); @Override void warnf(final String message, final Object firstArgument, final Object secondArgument, final Object thirdArgument); @Override void warnf(final Throwable exception, final String message, final Object... arguments); @Override void warnf(final Throwable exception, final String message, final Object argument); @Override void warnf(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument); @Override void warnf(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void error(final Object message); @Override void error(final Object message, final Throwable exception); @Override void error(final String loggerClassName, final Object message, final Throwable exception); @Override void error(final String loggerClassName, final Object message, final Object[] arguments, final Throwable exception); @Override void errorv(final String message, final Object... arguments); @Override void errorv(final String message, final Object argument); @Override void errorv(final String message, final Object firstArgument, final Object secondArgument); @Override void errorv(final String message, final Object firstArgument, final Object secondArgument, final Object thirdArgument); @Override void errorv(final Throwable exception, final String message, final Object... arguments); @Override void errorv(final Throwable exception, final String message, final Object argument); @Override void errorv(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument); @Override void errorv(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void errorf(final String message, final Object... arguments); @Override void errorf(final String message, final Object argument); @Override void errorf(final String message, final Object firstArgument, final Object secondArgument); @Override void errorf(final String message, final Object firstArgument, final Object secondArgument, final Object thirdArgument); @Override void errorf(final Throwable exception, final String message, final Object... arguments); @Override void errorf(final Throwable exception, final String message, final Object argument); @Override void errorf(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument); @Override void errorf(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void fatal(final Object message); @Override void fatal(final Object message, final Throwable exception); @Override void fatal(final String loggerClassName, final Object message, final Throwable exception); @Override void fatal(final String loggerClassName, final Object message, final Object[] arguments, final Throwable exception); @Override void fatalv(final String message, final Object... arguments); @Override void fatalv(final String message, final Object argument); @Override void fatalv(final String message, final Object firstArgument, final Object secondArgument); @Override void fatalv(final String message, final Object firstArgument, final Object secondArgument, final Object thirdArgument); @Override void fatalv(final Throwable exception, final String message, final Object... arguments); @Override void fatalv(final Throwable exception, final String message, final Object argument); @Override void fatalv(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument); @Override void fatalv(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void fatalf(final String message, final Object... arguments); @Override void fatalf(final String message, final Object argument); @Override void fatalf(final String message, final Object firstArgument, final Object secondArgument); @Override void fatalf(final String message, final Object firstArgument, final Object secondArgument, final Object thirdArgument); @Override void fatalf(final Throwable exception, final String message, final Object... arguments); @Override void fatalf(final Throwable exception, final String message, final Object argument); @Override void fatalf(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument); @Override void fatalf(final Throwable exception, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void log(final Level level, final Object message); @Override void log(final Level level, final Object message, final Throwable exception); @Override void logv(final Level level, final String message, final Object... arguments); @Override void logv(final Level level, final String message, final Object argument); @Override void logv(final Level level, final String message, final Object firstArgument, final Object secondArgument); @Override void logv(final Level level, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void logv(final Level level, final Throwable exception, final String message, final Object... arguments); @Override void logv(final Level level, final Throwable exception, final String message, final Object argument); @Override void logv(final Level level, final Throwable exception, final String message, final Object firstArgument,
		final Object secondArgument); @Override void logv(final Level level, final Throwable exception, final String message, final Object firstArgument,
		final Object secondArgument, final Object thirdArgument); @Override void logf(final Level level, final String message, final Object... arguments); @Override void logf(final Level level, final String message, final Object argument); @Override void logf(final Level level, final String message, final Object firstArgument, final Object secondArgument); @Override void logf(final Level level, final String message, final Object firstArgument, final Object secondArgument,
		final Object thirdArgument); @Override void logf(final Level level, final Throwable exception, final String message, final Object... arguments); @Override void logf(final Level level, final Throwable exception, final String message, final Object argument); @Override void logf(final Level level, final Throwable exception, final String message, final Object firstArgument,
		final Object secondArgument); @Override void logf(final Level level, final Throwable exception, final String message, final Object firstArgument,
		final Object secondArgument, final Object thirdArgument);  }
@Test public void logObjectMessage() { logger.log(org.jboss.logging.Logger.Level.DEBUG, 42); if (debugEnabled) { verify(provider).log(2, null, Level.DEBUG, null, null, 42, (Object[]) null); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } logger.log(org.jboss.logging.Logger.Level.WARN, 42); if (warnEnabled) { verify(provider).log(2, null, Level.WARN, null, null, 42, (Object[]) null); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } }
@Test public void logMessageAndException() { RuntimeException exception = new RuntimeException(); logger.log(org.jboss.logging.Logger.Level.DEBUG, "Boom!", exception); if (debugEnabled) { verify(provider).log(2, null, Level.DEBUG, exception, null, "Boom!", (Object[]) null); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } logger.log(org.jboss.logging.Logger.Level.WARN, "Boom!", exception); if (warnEnabled) { verify(provider).log(2, null, Level.WARN, exception, null, "Boom!", (Object[]) null); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } }
@Test public void logMessageAndExceptionWithLoggerClassName() { RuntimeException exception = new RuntimeException(); logger.log(org.jboss.logging.Logger.Level.DEBUG, TinylogLoggerTest.class.getName(), "Boom!", exception); if (debugEnabled) { verify(provider).log(eq(TinylogLoggerTest.class.getName()), isNull(), eq(Level.DEBUG), same(exception), any(JavaTextMessageFormatFormatter.class), eq("Boom!"), isNull()); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } logger.log(org.jboss.logging.Logger.Level.WARN, TinylogLoggerTest.class.getName(), "Boom!", exception); if (warnEnabled) { verify(provider).log(eq(TinylogLoggerTest.class.getName()), isNull(), eq(Level.WARN), same(exception), any(JavaTextMessageFormatFormatter.class), eq("Boom!"), isNull()); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } }
@Test public void logFormattedMessageAndExceptionWithLoggerClassName() { RuntimeException exception = new RuntimeException(); logger.log(TinylogLoggerTest.class.getName(), org.jboss.logging.Logger.Level.DEBUG, "Hello {0}!", new Object[] { "Error" }, exception); if (debugEnabled) { verify(provider).log(eq(TinylogLoggerTest.class.getName()), isNull(), eq(Level.DEBUG), same(exception), any(JavaTextMessageFormatFormatter.class), eq("Hello {0}!"), eq("Error")); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } logger.log(TinylogLoggerTest.class.getName(), org.jboss.logging.Logger.Level.WARN, "Hello {0}!", new Object[] { "Error" }, exception); if (warnEnabled) { verify(provider).log(eq(TinylogLoggerTest.class.getName()), isNull(), eq(Level.WARN), same(exception), any(JavaTextMessageFormatFormatter.class), eq("Hello {0}!"), eq("Error")); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } }