Esempio n. 1
0
//----------------------------------------------------------------//
void MOAILogMgr::LogVar ( lua_State *L, u32 messageID, va_list args ) {

	if ( this->mLevel ) {

		MessageMapIt messageMapIt = this->mMessageMap.find ( messageID );
		if ( messageMapIt != this->mMessageMap.end ()) {
		
			MOAILogMessage& message = messageMapIt->second;
			
			if ( message.mLevel <= this->mLevel ) {
				
				if ( L ) {
					this->Print ( "----------------------------------------------------------------\n" );
				}
				
				this->PrintVar ( message.mFormatString, args );
				this->Print ( "\n" );
				
				if ( L ) {
					MOAILuaState state ( L );
					state.PrintStackTrace ( this->mFile, 0 );
					this->Print ( "\n" );
				}
			}
		}
	}
}
Esempio n. 2
0
//----------------------------------------------------------------//
int MOAILuaObject::_tombstone ( lua_State* L ) {

	MOAILuaState state ( L );
	
	ZLLog::Print ( "----------------------------------------------------------------\n" );
	ZLLog::Print ( "ERROR: Attempt to access missing object instance.\n" );
	state.PrintStackTrace ( ZLLog::CONSOLE, 0 );
	ZLLog::Print ( "\n" );
	
	return 0;
}
Esempio n. 3
0
//----------------------------------------------------------------//
int MOAILuaRuntime::_panic ( lua_State *L ) {

	MOAILuaState state ( L );
	state.PrintStackTrace ( ZLLog::CONSOLE, 1 );

	#ifdef ANDROID
		ZLLog::Print ( "PANIC: unprotected error in call to Lua API (%s)\n", lua_tostring ( L, -1 ));
	#else
		fprintf ( stderr, "PANIC: unprotected error in call to Lua API (%s)\n", lua_tostring ( L, -1 ));
	#endif
	
	return 0;
}