Skip to content

Commit

Permalink
Reduce test logging level
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Oct 13, 2017
1 parent 5d1f1fc commit d103253
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/test/java/com/lambdaworks/LoggingTestRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ public Statement apply(Statement base, FrameworkMethod method, Object target) {
@Override
public void evaluate() throws Throwable {
Logger logger = LogManager.getLogger(method.getMethod().getDeclaringClass());
logger.info("---------------------------------------");
logger.info("-- Invoke method " + method.getMethod().getDeclaringClass().getSimpleName() + "."
+ method.getName());
logger.info("---------------------------------------");
if (logger.isInfoEnabled()) {
logger.info("---------------------------------------");
logger.info("-- Invoke method " + method.getMethod().getDeclaringClass().getSimpleName() + "."
+ method.getName());
logger.info("---------------------------------------");
}

try {
base.evaluate();
Expand All @@ -59,10 +61,12 @@ public void evaluate() throws Throwable {

throw t;
} finally {
logger.info("---------------------------------------");
logger.info("-- Finished method " + method.getMethod().getDeclaringClass().getSimpleName() + "."
+ method.getName());
logger.info("---------------------------------------");
if (logger.isInfoEnabled()) {
logger.info("---------------------------------------");
logger.info("-- Finished method " + method.getMethod().getDeclaringClass().getSimpleName() + "."
+ method.getName());
logger.info("---------------------------------------");
}
}
}
};
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/log4j2-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<File name="File" fileName="target/lettuce.log" bufferedIO="true">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%-5p] [%t] %m (%c{1}:%L)%n"/>
<ThresholdFilter level="FATAL"/>
</File>
</Appenders>

Expand Down

0 comments on commit d103253

Please sign in to comment.