Page 1 of 1

Is there a way to print from a Lua script to the console?

Posted: Sun Sep 03, 2017 7:11 pm
by hackr
I was experimenting with editing a Lua script in the motor imagery example scenario. For learning and development purposes, I was wondering if there's a want to print data in the Lua script and have it appear in the OpenViBE console? If not, is there some other way to print values in the Lua script?

I tried simply adding some print statements to the script, but of course that did not work.

Thanks in advance!

Re: Is there a way to print from a Lua script to the console

Posted: Mon Sep 04, 2017 1:52 pm
by tgaugry
Hi,

You can use box:log(log_level, line_of_text).
Sample script from OpenViBE also suggest that io.write should work.

Cheers,

Re: Is there a way to print from a Lua script to the console

Posted: Mon Sep 04, 2017 2:57 pm
by hackr
tgaugry wrote:Hi,

You can use box:log(log_level, line_of_text).
Sample script from OpenViBE also suggest that io.write should work.

Cheers,
That's very helpful, thank you very much!