Hi,
my test code is using log4j2 to print out things during the test execution. If I use the the highlighting mode of log4j2 I get extra blank lines after every log line.
I can also make it look correct by leaving the newline at the end of my pattern away but then it doesn’t work in all other places anymore, like in Eclipse (using the ANSI console).
I can reproduce the problem. The issue here seems to be that the logging is processed through Gradle’s test logging infrastructure which processes messages to standard out line by line. My assumption is it interprets the formatting characters following the \n in a log message as more characters to be printed in the next line and then adds another newline at the end of the message, thus leading to two new lines in total.
Defining the pattern like this (putting %n in the very end) is a workaround: