use of org.eclipse.persistence.logging.slf4j.SLF4JLogger in project eclipselink by eclipse-ee4j.
the class SLF4JLoggerTest method testGetLevel.
/**
* Test {@code SLF4JLogger.getLevel()} method.
*/
@Test
public void testGetLevel() {
final int configuredDefaultLevel = AbstractSessionLog.getDefaultLoggingLevel();
final SLF4JLogger logger = new SLF4JLogger();
final SLF4JLoggerHelper helper = new SLF4JLoggerHelper((AbstractSession) session, loggerContext, logger);
logger.setSession(session);
final int defaultLevel = logger.getLevel();
final String defaultLevelString = LogLevelHelper.logIdToName(defaultLevel);
assertEquals("SLF4J logging level " + defaultLevelString + " did not match configured level " + configuredDefaultLevel, configuredDefaultLevel, defaultLevel);
helper.testCategoryDefaultLevels(logger);
}
use of org.eclipse.persistence.logging.slf4j.SLF4JLogger in project eclipselink by eclipse-ee4j.
the class SLF4JLoggerTest method testLogExceptionStackTrace.
/**
* Test {@code SLF4JLogger.log(SessionLogEntry)} method with {@link Throwable} and stack trace logging turned on.
*/
@Test
public void testLogExceptionStackTrace() {
final SLF4JLogger logger = new SLF4JLogger();
final SLF4JLoggerHelper helper = new SLF4JLoggerHelper((AbstractSession) session, loggerContext, logger);
logger.setSession(session);
logger.setShouldLogExceptionStackTrace(true);
helper.testLogExceptionStackTrace();
}
use of org.eclipse.persistence.logging.slf4j.SLF4JLogger in project eclipselink by eclipse-ee4j.
the class SLF4JLoggerTest method testLogExceptionWithoutStackTrace.
/**
* Test {@code SLF4JLogger.log(SessionLogEntry)} method with {@link Throwable} and stack trace logging turned off.
*/
@Test
public void testLogExceptionWithoutStackTrace() {
final SLF4JLogger logger = new SLF4JLogger();
final SLF4JLoggerHelper helper = new SLF4JLoggerHelper((AbstractSession) session, loggerContext, logger);
logger.setSession(session);
logger.setShouldLogExceptionStackTrace(false);
helper.testLogExceptionWithoutStackTrace();
}
use of org.eclipse.persistence.logging.slf4j.SLF4JLogger in project eclipselink by eclipse-ee4j.
the class SLF4JLoggerTest method testLogMessage.
/**
* Test {@code SLF4JLogger.log(SessionLogEntry)} method with regular {@link String} message.
*/
@Test
public void testLogMessage() {
final SLF4JLogger logger = new SLF4JLogger();
final SLF4JLoggerHelper helper = new SLF4JLoggerHelper((AbstractSession) session, loggerContext, logger);
logger.setSession(session);
helper.testLogMessage();
}
Aggregations