I found that by using -i
and -d
flags gradle can output info and debug information/logs.
Somthing like below -
./gradlew myprj:integrationTest -i
#outputs info information/logs
But rather than passing -i
flag on command line I want to set this options through gradle scripts i.e build.gradle
etc. (Since on the remote build server I cannot pass the -i
option yet)
I tried below in build.gradle
file - but it did not help. I don’t get info level log with below.
test {
testLogging {
events 'passed', 'failed', 'standardOut', 'standardError'
info.events 'STARTED', 'PASSED', 'SKIPPED', 'FAILED', 'STANDARD_OUT', 'STANDARD_ERROR'
}
}
Edit:
I could get hold of the logger for integrationTest
.
tasks.named('integrationTest') {
doFirst {
def logger = getLogger()
def originalLevel = logger.isInfoEnabled()
print 'info logging enabled: ' + originalLevel //output false
}
}
But there is NO setLevel
method/prop etc for the logger
.