testing_faq.md: provide sample for log level config

This commit is contained in:
Yann Cébron 2023-03-16 16:00:58 +01:00
parent 5dd1d1b775
commit c57140442c

View File

@ -61,9 +61,34 @@ In such cases, simply delete <path>test-system/caches</path> in your [sandbox di
### How to enable DEBUG/TRACE logging? ### How to enable DEBUG/TRACE logging?
Provide JVM system properties (Gradle: via `systemProperty` for `test` task) `idea.log.debug.categories` or `idea.log.trace.categories`, respectively. Provide JVM system properties `idea.log.debug.categories` or `idea.log.trace.categories` to specify logger category name, respectively.
Multiple categories can be set using a comma separated value list. Multiple categories can be set using a comma separated value list.
**Sample** Set DEBUG level for categories `com.my.plugin.ui` and `com.my.plugin.backend`:
<tabs group="languages">
<tab title="Kotlin" group-key="kotlin">
```kotlin
tasks {
test {
systemProperty("idea.log.debug.categories", "com.my.plugin.ui,com.my.plugin.backend")
}
}
```
</tab>
<tab title="Groovy" group-key="groovy">
```groovy
test {
systemProperty("idea.log.debug.categories", "com.my.plugin.ui,com.my.plugin.backend")
}
```
</tab>
</tabs>
### How to get separate logs for failing tests? ### How to get separate logs for failing tests?
Set system property `idea.split.test.logs` to `true` to generate separate test log files in <path>splitTestLogs</path> subdirectory for failing tests (WARN/ERROR level messages) (2021.3). Set system property `idea.split.test.logs` to `true` to generate separate test log files in <path>splitTestLogs</path> subdirectory for failing tests (WARN/ERROR level messages) (2021.3).