use of org.spf4j.test.log.CollectTrobleshootingLogs in project spf4j by zolyfarkas.
the class Spf4jTestLogRunListenerSingleton method testStarted.
@Override
public void testStarted(final Description description) throws Exception {
Test ta = description.getAnnotation(Test.class);
ExecutionContext ctx;
if (ta != null && ta.timeout() > 0) {
ctx = ExecutionContexts.start(description.getDisplayName(), ta.timeout(), TimeUnit.MILLISECONDS);
} else {
ctx = ExecutionContexts.start(description.getDisplayName());
}
CollectTrobleshootingLogs ca = description.getAnnotation(CollectTrobleshootingLogs.class);
Level mll = ca == null ? minLogLevel : ca.minLevel();
boolean clp = ca == null ? collectPrinted : ca.collectPrinted();
collections.put(description, TestLoggers.sys().collect(mll, maxDebugLogsCollected, clp));
ctxts.put(description, ctx);
super.testStarted(description);
}
Aggregations