Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Can we redirect the output of Canton Console to a file?Forum ↗

Can we redirect the output of Canton Console to a file?

App Development4 posts165 views3 likesLast activity Mar 2024
GY
gyorgybalazsiOP
Jan 2024

Like this in the terminal:

echo "hello world" > hello.txt
BE
Ben_M
Mar 2024

Try these for further guidance as the Ammonite REPL is what the Canton Console really is:

Hope this helps, BM.

RO
rohitt
Mar 2024

Hi @gyorgybalazsi :wave:

I tried this and it worked for me:


@ import java.io.{File, FileOutputStream}
import java.io.{File, FileOutputStream}

@ val fos = new FileOutputStream(new File("<ENTER FILE PATH/NAME>"))
fos: FileOutputStream = java.io.FileOutputStream@1a67bde5

@ Console.withOut(fos) { println(health.status) }


@
GY
gyorgybalazsi
Mar 2024

Thank you!

← Back to Discussions