You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Schalk Cronjé <ys...@gmail.com> on 2016/03/26 21:27:16 UTC

Debug logging in AntBuilder

When using Ant from the command0line one can pass -debug to turn debug 
logging on. I want to do the same when using an AntBuilder instance, but 
i cannot any reference on how this can be done (or whther it is indeed 
possible).

Any pointers?

-- 
Schalk W. Cronjé
Twitter / Ello / Toeter : @ysb33r


Re: Debug logging in AntBuilder

Posted by Schalk Cronjé <ys...@gmail.com>.
Having said that, I discovered that I could just check whether the 
BuildListener was an instance of DefaultLogger, which is all I needed

    ant.project.buildListebers.each {
         if(it instance of DefaultLogger) {
           it.messageOutputLevel = ant.project.MSG_DEBUG
         }
    }

Thanks for the pointer.

On 28/03/2016 18:37, Schalk Cronjé wrote:
> Unfortunately that does not work for me. Having checked the Ant docs, 
> there is not messageOutputLevel on BuildLIstener.
>
> On 28/03/2016 17:51, Nelson, Erick wrote:
>> Along with CliBuilder....
>>
>> def ant = new AntBuilder()
>> ant.project.buildListeners.each { it.messageOutputLevel = 
>> ant.project.MSG_DEBUG }
>>
>>
>> Erick Nelson
>> Senior Developer | IT Application Development
>> HD Supply Facilities Maintenance
>> O: 858-831-2209
>> C: 760-473-7542
>> H: 760-930-0461
>> Erick.Nelson@hdsupply.com
>>
>> -----Original Message-----
>> From: Schalk Cronjé [mailto:ysb33r@gmail.com]
>> Sent: Saturday, March 26, 2016 1:27 PM
>> To: users@groovy.apache.org
>> Subject: Debug logging in AntBuilder
>>
>> When using Ant from the command0line one can pass -debug to turn debug
>> logging on. I want to do the same when using an AntBuilder instance, but
>> i cannot any reference on how this can be done (or whther it is indeed
>> possible).
>>
>> Any pointers?
>>
>
>


-- 
Schalk W. Cronjé
Twitter / Ello / Toeter : @ysb33r


Re: Debug logging in AntBuilder

Posted by Schalk Cronjé <ys...@gmail.com>.
it seems to fail if AntBuilder is created within a Gradle plugin (at 
least with Gradle 2.0).

On 28/03/2016 18:47, Nelson, Erick wrote:
> Curious
>
> Antbuilder seems to have a console appender by default
>
>
>
> When I run this...
>
> def ant = new AntBuilder()
> ant.project.buildListeners.each { it.messageOutputLevel = ant.project.MSG_DEBUG }
> ant.project.log('debug test', project.MSG_DEBUG)
> ant.project.log('info test', project.MSG_INFO)
> ant.project.log('error test', project.MSG_ERR)
>
> I get this...
>
> debug test
> info test
> error test
>
>
>
> And when I run this...
>
> def ant = new AntBuilder()
> ant.project.buildListeners.each { it.messageOutputLevel = ant.project.MSG_DEBUG }
> ant.project.log('debug test', project.MSG_DEBUG)
> ant.project.log('info test', project.MSG_INFO)
> ant.project.log('error test', project.MSG_ERR)
>
> I get this...
>
> info test
> error test
>
>
>
>
> And when I run this...
>
> def ant = new AntBuilder()
> ant.project.buildListeners.each { it.messageOutputLevel = ant.project.MSG_ERR }
> ant.project.log('debug test', project.MSG_DEBUG)
> ant.project.log('info test', project.MSG_INFO)
> ant.project.log('error test', project.MSG_ERR)
>
> I get this...
>
> error test
>
>
>
>
>
>
> -----Original Message-----
> From: Schalk Cronjé [mailto:ysb33r@gmail.com]
> Sent: Monday, March 28, 2016 10:37 AM
> To: users@groovy.apache.org
> Subject: Re: Debug logging in AntBuilder
>
> Unfortunately that does not work for me. Having checked the Ant docs,
> there is not messageOutputLevel on BuildLIstener.
>
> On 28/03/2016 17:51, Nelson, Erick wrote:
>> Along with CliBuilder....
>>
>> def ant = new AntBuilder()
>> ant.project.buildListeners.each { it.messageOutputLevel = ant.project.MSG_DEBUG }
>>
>>
>> -----Original Message-----
>> From: Schalk Cronjé [mailto:ysb33r@gmail.com]
>> Sent: Saturday, March 26, 2016 1:27 PM
>> To: users@groovy.apache.org
>> Subject: Debug logging in AntBuilder
>>
>> When using Ant from the command0line one can pass -debug to turn debug
>> logging on. I want to do the same when using an AntBuilder instance, but
>> i cannot any reference on how this can be done (or whther it is indeed
>> possible).
>>
>> Any pointers?
>>
>


-- 
Schalk W. Cronjé
Twitter / Ello / Toeter : @ysb33r


RE: Debug logging in AntBuilder

Posted by "Nelson, Erick" <Er...@hdsupply.com>.
Curious

Antbuilder seems to have a console appender by default



When I run this...

def ant = new AntBuilder()
ant.project.buildListeners.each { it.messageOutputLevel = ant.project.MSG_DEBUG }
ant.project.log('debug test', project.MSG_DEBUG)
ant.project.log('info test', project.MSG_INFO)
ant.project.log('error test', project.MSG_ERR)

I get this...

debug test
info test
error test



And when I run this...

def ant = new AntBuilder()
ant.project.buildListeners.each { it.messageOutputLevel = ant.project.MSG_DEBUG }
ant.project.log('debug test', project.MSG_DEBUG)
ant.project.log('info test', project.MSG_INFO)
ant.project.log('error test', project.MSG_ERR)

I get this...

info test
error test




And when I run this...

def ant = new AntBuilder()
ant.project.buildListeners.each { it.messageOutputLevel = ant.project.MSG_ERR }
ant.project.log('debug test', project.MSG_DEBUG)
ant.project.log('info test', project.MSG_INFO)
ant.project.log('error test', project.MSG_ERR)

I get this...

error test






-----Original Message-----
From: Schalk Cronjé [mailto:ysb33r@gmail.com] 
Sent: Monday, March 28, 2016 10:37 AM
To: users@groovy.apache.org
Subject: Re: Debug logging in AntBuilder

Unfortunately that does not work for me. Having checked the Ant docs, 
there is not messageOutputLevel on BuildLIstener.

On 28/03/2016 17:51, Nelson, Erick wrote:
> Along with CliBuilder....
>
> def ant = new AntBuilder()
> ant.project.buildListeners.each { it.messageOutputLevel = ant.project.MSG_DEBUG }
>
>
> -----Original Message-----
> From: Schalk Cronjé [mailto:ysb33r@gmail.com]
> Sent: Saturday, March 26, 2016 1:27 PM
> To: users@groovy.apache.org
> Subject: Debug logging in AntBuilder
>
> When using Ant from the command0line one can pass -debug to turn debug
> logging on. I want to do the same when using an AntBuilder instance, but
> i cannot any reference on how this can be done (or whther it is indeed
> possible).
>
> Any pointers?
>


-- 
Schalk W. Cronjé
Twitter / Ello / Toeter : @ysb33r


Re: Debug logging in AntBuilder

Posted by Schalk Cronjé <ys...@gmail.com>.
Unfortunately that does not work for me. Having checked the Ant docs, 
there is not messageOutputLevel on BuildLIstener.

On 28/03/2016 17:51, Nelson, Erick wrote:
> Along with CliBuilder....
>
> def ant = new AntBuilder()
> ant.project.buildListeners.each { it.messageOutputLevel = ant.project.MSG_DEBUG }
>
>
> Erick Nelson
> Senior Developer | IT Application Development
> HD Supply Facilities Maintenance
> O: 858-831-2209
> C: 760-473-7542
> H: 760-930-0461
> Erick.Nelson@hdsupply.com
>
> -----Original Message-----
> From: Schalk Cronjé [mailto:ysb33r@gmail.com]
> Sent: Saturday, March 26, 2016 1:27 PM
> To: users@groovy.apache.org
> Subject: Debug logging in AntBuilder
>
> When using Ant from the command0line one can pass -debug to turn debug
> logging on. I want to do the same when using an AntBuilder instance, but
> i cannot any reference on how this can be done (or whther it is indeed
> possible).
>
> Any pointers?
>


-- 
Schalk W. Cronjé
Twitter / Ello / Toeter : @ysb33r


RE: Debug logging in AntBuilder

Posted by "Nelson, Erick" <Er...@hdsupply.com>.
Along with CliBuilder....

def ant = new AntBuilder()
ant.project.buildListeners.each { it.messageOutputLevel = ant.project.MSG_DEBUG }


Erick Nelson
Senior Developer | IT Application Development
HD Supply Facilities Maintenance
O: 858-831-2209
C: 760-473-7542
H: 760-930-0461
Erick.Nelson@hdsupply.com

-----Original Message-----
From: Schalk Cronjé [mailto:ysb33r@gmail.com] 
Sent: Saturday, March 26, 2016 1:27 PM
To: users@groovy.apache.org
Subject: Debug logging in AntBuilder

When using Ant from the command0line one can pass -debug to turn debug 
logging on. I want to do the same when using an AntBuilder instance, but 
i cannot any reference on how this can be done (or whther it is indeed 
possible).

Any pointers?

-- 
Schalk W. Cronjé
Twitter / Ello / Toeter : @ysb33r