本文整理汇总了C++中MOAIScopedLuaState::PrintStackTrace方法的典型用法代码示例。如果您正苦于以下问题:C++ MOAIScopedLuaState::PrintStackTrace方法的具体用法?C++ MOAIScopedLuaState::PrintStackTrace怎么用?C++ MOAIScopedLuaState::PrintStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MOAIScopedLuaState
的用法示例。
在下文中一共展示了MOAIScopedLuaState::PrintStackTrace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleError
//----------------------------------------------------------------//
void MOAIHarness::HandleError(const char* message, lua_State* L, int level)
{
if (MOAIHarness::mSocketID == -1)
{
ZLLog::LogF ( "%s\n", message );
MOAIScopedLuaState state ( L );
state.PrintStackTrace ( ZLLog::CONSOLE, NULL, level );
}
else
{
// Package the call stack into a json object
json_t* stack = ConvertCallStackToJSON(L, 0);
MOAIHarness::SendError(message, stack, level);
MOAIHarness::Pause(L);
}
}
示例2: _traceback
//----------------------------------------------------------------//
int MOAILuaRuntime::_traceback ( lua_State *L ) {
MOAILuaState state ( L );
cc8* msg = NULL;
if ( lua_isstring ( L, 1 )) { // 'message' a string?
msg = lua_tostring ( L, 1 );
}
TracebackFunc tracebackFunc = MOAILuaRuntime::Get ().mTracebackFunc;
if ( tracebackFunc ) {
tracebackFunc ( msg, L, 0 );
}
else {
if ( msg ) {
ZLLog::Print ( "%s\n", msg );
}
MOAIScopedLuaState state ( L );
state.PrintStackTrace ( ZLLog::CONSOLE, 0 );
}
return 0;
}