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

Come here to discuss about OpenViBE in general!
Post Reply
hackr
Posts: 12
Joined: Fri Aug 25, 2017 1:41 am

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

Post 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!

tgaugry
Posts: 68
Joined: Thu Feb 09, 2017 10:17 am

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

Post 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,

hackr
Posts: 12
Joined: Fri Aug 25, 2017 1:41 am

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

Post 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!

Post Reply