Q:

How to set the error output stream for lua in c++

I've implemented lua in my c++ project but right now it writes all errors and syntax errors to the console. Is there way to set a custom function in c++ to receive the errors instead?

A:

Run your Lua code using lua_pcall and retrieve your errors from the result.

