I'm trying to redirect script output to a `Flow<St...
# scripting
c
I'm trying to redirect script output to a
Flow<String>
Attached is a scratch file I'm playing in, it prints
test
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
I answered in the issue.
c
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
I'll have a look at the GroovyShell, maybe there are some other ways to tackle this problem. Thanks for the hint.
d
Does println in scripts not go to System.out ?Q
i
Script uses platform i/o directly, without any interception layer, so yes.