Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

Re: [groovy-user] debugging state dumping question

Raoul Duke

2008-08-22

Replies: Find Java Web Hosting

Author LoginPost Reply
P.S. i should have mentioned that ideally it would be Java code doing
the logging. So we'd have a groovy.lang.Script object in Java and
would like to dump the variables in it. if that makes any sense.

On Fri, Aug 22, 2008 at 12:38 PM, Erick Erickson
<erickerickson@(protected):
> This works for variables in the binding, i.e. things not
> declared with "def" or a strong type.
>
> bonkers = "some stuff"
>
> binding.variables.each {key, val ->
>   println "$key -> $val"
> }
>
>
> I'm not clear how to get variables that are declared with "def" etc.
> though, is that what you need?
>
> HTH
> Erick
>
> On Fri, Aug 22, 2008 at 3:08 PM, Raoul Duke <raould@(protected):
>>
>> hi,
>>
>> (haven't found an answer / lead via searching yet.)
>>
>> i would very much like to be able to dump the current state of a
>> groovy script. by that i mean: the script has variables declared and
>> manipulated in the script. i'd like to be able to dump out the values
>> of all those variables. how might i do that at an arbitrary point at
>> runtime?
>>
>> many thanks for any clues. :)
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>   http://xircles.codehaus.org/manage_email
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.