Or is this question academical? But then again, making basically domain layer code, dependent dependent on the Gradle API, seems to reduce the potential reusability.
You can use pretty much any logging framework you want. It’ll all get redirected appropriately. I’d probably suggest just using SLF4j, as that’s what Gradle’s API extends from. The only limitation is that you won’t have access to Gradle specific logging levels such as LIFECYCLE or QUIET.
Great. I tested this in a Gradle Plugin project of mine and it works.
But in the Integration Tests - tests without any Gradle Dependencies - the following Standard Output is confusing me:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/chhex/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-simple/1.7.29/82ae07f95088577987a15d90171de12b00d81847/slf4j-simple-1.7.29.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/chhex/.gradle/caches/5.0/generated-gradle-jars/gradle-api-5.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
This even though i did’t see any gradle dependencies in the htmlDependency Report.
I have a configuration defined as follows:
val integrationTestRuntimeOnly: Configuration by configurations.getting {
extendsFrom(configurations.testRuntimeOnly.get())
}