I'm trying to redirect script output to a `Flow<St...
# scripting
I'm trying to redirect script output to a
Attached is a scratch file I'm playing in, it prints
whereas I expect it to print
Z: test
if output redirection worked. Any idea what am I doing wrong? Or is Kotlin ScriptEngine just ignoring context that is passed in to eval?
I answered in the issue.
Thanks. I'm still trying to make dynamic console for an app with Kotlin instead of using GroovyShell, this was the final thing I needed for feature parity. For now it's just serviceable, I have to pass in some custom output handle through bindings and explicitly use it instead of standard logging or even println, both of which worked without problem with output redirection of GroovyShell.
I'll have a look at the GroovyShell, maybe there are some other ways to tackle this problem. Thanks for the hint.
Does println in scripts not go to System.out ?Q
Script uses platform i/o directly, without any interception layer, so yes.