Adds log message customization to the TestNG event listener. It is now possible to add arbitrary information to log messages, such as Xray annotation keys:
// Old
[Test] [some.package.SomeTest.login] success
// New
[Test] [QTAF-123] [some.package.SomeTest.login] success
The logging subscriber provides a method for registering enhancers:
/**
* Registers a log message enhancer which will be called whenever this subscriber prints a log message.
*
* @param enhancer the enhancing function
*/
public void addLogMessageEnhancer(Function<ITestResult, Optional<String>> enhancer) {
this.logMessageEnhancers.add(enhancer);
}
The enhancing function receives the test result object and can decide whether to add more log output:
Adds log message customization to the TestNG event listener. It is now possible to add arbitrary information to log messages, such as Xray annotation keys:
The logging subscriber provides a method for registering enhancers:
The enhancing function receives the test result object and can decide whether to add more log output: