@Test public void validateDelegateLoggerReceivesThrowableToStringOnTrace() { componentLog.trace("Hello {}", e); verify(logger, times(1)).trace(anyString(), argThat(new MyVarargMatcher())); }
@Override public void trace(String msg, Throwable t) { if (!isTraceEnabled()) { return; } msg = "{} " + msg; final Object[] os = {component, t.toString(), t}; logger.trace(msg, os); logRepository.addLogMessage(LogLevel.TRACE, msg, os, t); }
SimpleProcessLogger implements ComponentLog { @Override public void trace(String msg, Throwable t) { if (!isTraceEnabled()) { return; } msg = "{} " + msg; final Object[] os = {component, t.toString(), t}; logger.trace(msg, os); logRepository.addLogMessage(LogLevel.TRACE, msg, os, t); } }
SimpleProcessLogger implements ComponentLog { @Override public void trace(String msg, Throwable t) { if (!isTraceEnabled()) { return; } msg = "{} " + msg; final Object[] os = {component, t.toString(), t}; logger.trace(msg, os); logRepository.addLogMessage(LogLevel.TRACE, msg, os, t); } SimpleProcessLogger(final String componentId, final Object component); }
SimpleProcessLogger implements ComponentLog { @Override public void trace(String msg, Throwable t) { if (!isTraceEnabled()) { return; } msg = "{} " + msg; final Object[] os = {component, t.toString(), t}; logger.trace(msg, os); logRepository.addLogMessage(LogLevel.TRACE, msg, os, t); } SimpleProcessLogger(final String componentId, final Object component); @Override void warn(String msg, final Throwable t); @Override void warn(String msg, Object[] os); @Override void warn(String msg, Object[] os, final Throwable t); @Override void warn(String msg); @Override void trace(String msg, Throwable t); @Override void trace(String msg, Object[] os); @Override void trace(String msg); @Override void trace(String msg, Object[] os, Throwable t); @Override boolean isTraceEnabled(); @Override boolean isDebugEnabled(); @Override boolean isInfoEnabled(); @Override boolean isWarnEnabled(); @Override boolean isErrorEnabled(); @Override void info(String msg, Throwable t); @Override void info(String msg, Object[] os); @Override void info(String msg); @Override void info(String msg, Object[] os, Throwable t); @Override String getName(); @Override void error(String msg, Throwable t); @Override void error(String msg, Object[] os); @Override void error(String msg); @Override void error(String msg, Object[] os, Throwable t); @Override void debug(String msg, Throwable t); @Override void debug(String msg, Object[] os); @Override void debug(String msg, Object[] os, Throwable t); @Override void debug(String msg); @Override void log(LogLevel level, String msg, Throwable t); @Override void log(LogLevel level, String msg, Object[] os); @Override void log(LogLevel level, String msg); @Override void log(LogLevel level, String msg, Object[] os, Throwable t); }
SimpleProcessLogger implements ComponentLog { @Override public void trace(String msg, Throwable t) { if (!isTraceEnabled()) { return; } msg = "{} " + msg; final Object[] os = {component, t.toString(), t}; logger.trace(msg, os); logRepository.addLogMessage(LogLevel.TRACE, msg, os, t); } SimpleProcessLogger(final String componentId, final Object component); @Override void warn(String msg, final Throwable t); @Override void warn(String msg, Object[] os); @Override void warn(String msg, Object[] os, final Throwable t); @Override void warn(String msg); @Override void trace(String msg, Throwable t); @Override void trace(String msg, Object[] os); @Override void trace(String msg); @Override void trace(String msg, Object[] os, Throwable t); @Override boolean isTraceEnabled(); @Override boolean isDebugEnabled(); @Override boolean isInfoEnabled(); @Override boolean isWarnEnabled(); @Override boolean isErrorEnabled(); @Override void info(String msg, Throwable t); @Override void info(String msg, Object[] os); @Override void info(String msg); @Override void info(String msg, Object[] os, Throwable t); @Override String getName(); @Override void error(String msg, Throwable t); @Override void error(String msg, Object[] os); @Override void error(String msg); @Override void error(String msg, Object[] os, Throwable t); @Override void debug(String msg, Throwable t); @Override void debug(String msg, Object[] os); @Override void debug(String msg, Object[] os, Throwable t); @Override void debug(String msg); @Override void log(LogLevel level, String msg, Throwable t); @Override void log(LogLevel level, String msg, Object[] os); @Override void log(LogLevel level, String msg); @Override void log(LogLevel level, String msg, Object[] os, Throwable t);  }