Lua - Overriding stdout
Hi, I'm trying to embedd LUA with my application. However my application doesn't run a console so I can't see the results and everything.
Is there a way to override where Lua prints, like to a ostream. That way I can use a stringstream or something to retrieve the output.
I've searched over the forum and google and I don't seem to find a solution to this problem.
Quote:
Sure. Just make your own print function.
Sorry if this sounds newby but how do I override the other print? I mean like where do I put this new print function?
In the global table, exactly where you've put all the other C functions you've exposed to Lua so far.
Quote:Original post by jorelmb
Ohh! Now I get it, I always though this was done on the C API...
It is.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement