-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce log level of test Gradle projects #3717
Conversation
edb72b0
to
c8a1296
Compare
b7010d2
to
ac13a82
Compare
### Motivation Too many logs when using Gradle TestKit causes the tests to run slower. This is mainly because Gradle TestKit stores logs in-memory (see gradle/gradle#23965). Reducing the amount of logging would be beneficial for two reasons: - The tests can run faster. - The logs are not cluttered with unimportant messages from other Gradle tasks. We can focus on the Dokka Generator logs. However, reducing the log level to 'lifecycle' would mean that the Dokka Generator logs would not be reported. To work around this, I added an internal flag that can override the default log level of Dokka Generator. The result is that the tests run faster, and test results are easier to read and verify. ### Summary of changes - Reduce the log-level of Gradle tests to 'lifecycle' by default (this can be overridden if necessary). - Introduce an internal flag, `dokka.internal.dokkaGenerator.logLevelOverride`, in AbstractDokkaTask that can re-direct the logs of Dokka Generator to a specific level, independent from the Gradle log level. - Correctly enable `--stacktrace` on all tests, and enable it by default for all tests. ^OSIP-355
ac13a82
to
8cf4514
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, let's resolve small remarks and it's good to go
...-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt
Outdated
Show resolved
Hide resolved
...-gradle-plugin-classic/src/main/kotlin/org/jetbrains/dokka/gradle/tasks/AbstractDokkaTask.kt
Outdated
Show resolved
Hide resolved
override fun accept(level: String, message: String) { | ||
if (overrideLogger != null) { | ||
// when an override level is set, re-route all the messages | ||
overrideLogger.invoke(message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how I feel (love or hate), that when overriding logger level we will print all messages (even debug), but let's try :)
Motivation
Too many logs when using Gradle TestKit causes the tests to run slower. This is mainly because Gradle TestKit stores logs in-memory (see gradle/gradle#23965).
Reducing the amount of logging would be beneficial for two reasons:
However, reducing the log level to 'lifecycle' would mean that the Dokka Generator logs would not be reported. To work around this, I added an internal flag that can override the default log level of Dokka Generator.
The result is that the tests run faster, and test results are easier to read and verify.
Summary of changes
dokka.internal.gradle.dokkaGenerator.logLevelOverride
, in AbstractDokkaTask that can re-direct the logs of Dokka Generator to a specific level, independent from the Gradle log level.--stacktrace
on all tests, and enable it by default for all tests.^OSIP-355
Depends on