Re: Redirecting Output of groovy.util.GroovyScriptEngine to a custom Writer

2024-02-13 Thread Paul King
Hi Anadi, The output for any script can be set through the 'out' property in the binding: var script = File.createTempFile('myScript', '.groovy').tap { write ''' out.println 'hi' println 6 * 7 printf '%x%n', 6 * 7 out << 'bye' ''' deleteOnExit() } var s

Re: Redirecting Output of groovy.util.GroovyScriptEngine to a custom Writer

2024-02-13 Thread Jochen Theodorou
On 13.02.24 08:38, Anadi Kashyap wrote: Hello Groovy Developers and Community, Perhaps my last question was missed so I'm asking it again, would appreciate some direction here - I am currently working with groovy.util.GroovyScriptEngine and I have encountered a specific requirement where I need

Redirecting Output of groovy.util.GroovyScriptEngine to a custom Writer

2024-02-12 Thread Anadi Kashyap
Hello Groovy Developers and Community, Perhaps my last question was missed so I'm asking it again, would appreciate some direction here - I am currently working with groovy.util.GroovyScriptEngine and I have encountered a specific requirement where I need to redirect the output of the script engi

Redirecting Output of groovy.util.GroovyScriptEngine to a custom Writer

2023-11-17 Thread Anadi Kashyap
Hello Groovy Developers and Community, I am currently working with groovy.util.GroovyScriptEngine and I have encountered a specific requirement where I need to redirect the output of the script engine to a custom Writer, separate from the default stdout/stderr, without affecting the rest of the JV