Last active
August 29, 2015 14:02
-
-
Save EugeneLoy/9fcdd9801a86253629f4 to your computer and use it in GitHub Desktop.
Add this field to your test class to log names of the tests when they start. Works with JUnit 4.9+ and SLF4J.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Rule | |
public TestRule loggingRule = new TestWatcher() { | |
protected void starting(Description description) { | |
Logger logger = LoggerFactory.getLogger(description.getClassName()); | |
logger.info("Starting: {}", description.getMethodName()); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment