Is there a good way to obtain the LogLevel that is specified from the
command line? For example, if the -d switch is set I would want to get
LogLevel.DEBUG. I have tried using the script below but I alway get a null
result.

build.gradle

task viewLogLevel {
  println "Log Level : ${logging.level}"
}

$ gradle -v
------------------------------------------------------------
Gradle 1.0-milestone-3
------------------------------------------------------------

Gradle build time: Monday, 25 April 2011 5:40:11 PM EST
Groovy: 1.7.10
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.6.0_24 (Sun Microsystems Inc. 19.1-b02)
OS: Linux 2.6.38-8-generic i386

$ gradle viewLogLevel
...other logs...
Log Level : null

$ gradle -i viewLogLevel
...other logs...
Log Level : null

$ gradle -d viewLogLevel
...other logs...
00:11:28.777 [QUIET] [system.out] Log Level : null

Can someone point out what I am doing wrong?
Rob

Reply via email to