use of jodd.log.Logger in project jodd by oblac.
the class Slf4jLogbackLoggerTest method testLogger.
@Test
public void testLogger() {
PrintStream original = System.out;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
System.setOut(ps);
LoggerFactory.setLoggerFactory(new Slf4jLoggerFactory());
Logger log = LoggerFactory.getLogger("Foo");
log.warn("123");
System.out.flush();
System.setOut(original);
assertEquals("WARN Foo " + this.getClass().getName() + " testLogger 51 - 123", baos.toString().trim());
}
use of jodd.log.Logger in project jodd by oblac.
the class DbBaseTest method init.
protected void init() {
LoggerFactory.setLoggerFactory(new NOPLoggerFactory() {
@Override
public Logger getLogger(String name) {
return new NOPLogger("") {
@Override
public boolean isWarnEnabled() {
return true;
}
@Override
public void warn(String message) {
throw new UncheckedException("NO WARNINGS ALLOWED: " + message);
}
@Override
public void warn(String message, Throwable throwable) {
throw new UncheckedException("NO WARNINGS ALLOWED: " + message);
}
};
}
});
DbOomManager.resetAll();
dboom = DbOomManager.getInstance();
connectionPool = new CoreConnectionPool();
}
Aggregations