@Test public void testTraceWhenDisabled() throws Exception { Mockito.when(this.slf4jLogger.isTraceEnabled()).thenReturn(false); JsonLogger result = this.logger.trace(); assertTrue(result instanceof NoopLogger); }
public JsonLogger trace() { if (slf4jLogger.isTraceEnabled()) { StandardJsonLogger result = new StandardJsonLogger(this.slf4jLogger, this.formatter, this.gson, TRACE_LEVEL_NAME, this.slf4jLogger::trace, this.slf4jLogger::trace); this.configureLogger(result); return result; } return noopLogger; }
Logger { public JsonLogger trace() { if (slf4jLogger.isTraceEnabled()) { StandardJsonLogger result = new StandardJsonLogger(this.slf4jLogger, this.formatter, this.gson, TRACE_LEVEL_NAME, this.slf4jLogger::trace, this.slf4jLogger::trace); this.configureLogger(result); return result; } return noopLogger; } }
Logger { public JsonLogger trace() { if (slf4jLogger.isTraceEnabled()) { StandardJsonLogger result = new StandardJsonLogger(this.slf4jLogger, this.formatter, this.gson, TRACE_LEVEL_NAME, this.slf4jLogger::trace, this.slf4jLogger::trace); this.configureLogger(result); return result; } return noopLogger; } Logger(org.slf4j.Logger slf4jLogger, FastDateFormat formatter); }
Logger { public JsonLogger trace() { if (slf4jLogger.isTraceEnabled()) { StandardJsonLogger result = new StandardJsonLogger(this.slf4jLogger, this.formatter, this.gson, TRACE_LEVEL_NAME, this.slf4jLogger::trace, this.slf4jLogger::trace); this.configureLogger(result); return result; } return noopLogger; } Logger(org.slf4j.Logger slf4jLogger, FastDateFormat formatter); boolean isIncludeLoggerName(); void setIncludeLoggerName(boolean includeLoggerName); boolean isIncludeThreadName(); void setIncludeThreadName(boolean includeThreadName); boolean isIncludeClassName(); void setIncludeClassName(boolean includeClassName); JsonLogger trace(); JsonLogger debug(); JsonLogger info(); JsonLogger warn(); JsonLogger error(); }
Logger { public JsonLogger trace() { if (slf4jLogger.isTraceEnabled()) { StandardJsonLogger result = new StandardJsonLogger(this.slf4jLogger, this.formatter, this.gson, TRACE_LEVEL_NAME, this.slf4jLogger::trace, this.slf4jLogger::trace); this.configureLogger(result); return result; } return noopLogger; } Logger(org.slf4j.Logger slf4jLogger, FastDateFormat formatter); boolean isIncludeLoggerName(); void setIncludeLoggerName(boolean includeLoggerName); boolean isIncludeThreadName(); void setIncludeThreadName(boolean includeThreadName); boolean isIncludeClassName(); void setIncludeClassName(boolean includeClassName); JsonLogger trace(); JsonLogger debug(); JsonLogger info(); JsonLogger warn(); JsonLogger error(); static final String TRACE_LEVEL_NAME; static final String DEBUG_LEVEL_NAME; static final String INFO_LEVEL_NAME; static final String WARN_LEVEL_NAME; static final String ERROR_LEVEL_NAME; }