Why does this code fragment:
if (iErr) {
std::stringstream ss;
string serror("error");
ss << "lua error code " << iErr << ": " << lua_tostring(lua, -1);
ss >> serror;
Log *log= StandardLog::getInstance();
log->logError("Lua error following in next line");
log->logError(serror);
//lua_pop(lua, 1);/* pop error message from the stack */
return 1;
}
just print:
Lua error following in next line
lua
instead of
Lua error following in next line
lua error code 3: lua/generator/generator_example_nodenavigator.lua:10: attempt to call global 'require' (a nil value)
The Logger lines look like this:
void Logger::log(char message[]){
string smessage(message);
log(smessage);
}
void Logger::log(string smessage){
...
}
but it appears the logger is not at fault, since i get the same output using cerr.