Configure LogLevel in Intellji Junit Run config in gradle project?
3 answers
Registration for tests must be configured correctly or we are going to the default, which is LOG ALL. At least that's my theory.
- Create test /resources/logback.xml
- Fill it out with the basic form
- customize for use.
Below we just force everything to log information. Ideally, I want org.apache. * @Info and my classes when debugging, but I need me to learn the logback.xml format (next)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p | %t | %-55logger{55} | %m %n</pattern>
</encoder>
</appender>
<root>
<level value="INFO"/>
<appender-ref ref="CONSOLE"/>
</root>
</configuration>
+5
source to share
You need to set up the logging frameworks (logs) used by the code under test, eg. by placing the config file in src/test/resources
. How exactly this is done depends on the logging structure used.
PS: Unless it's about Android Studio, Gradle is not involved when running a unit test from IntelliJ.
0
source to share