On 03/05/2011, at 3:14 PM, Robert Winch wrote:
> Is there a good way to obtain the LogLevel that is specified from the command
> line?
Could you give us some more details of what you want to use the log level for?
There might be some other way to achieve what you want.
> 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
--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com