Libretro: Disable logging game errors, BIOS calls and stubs in release builds

This commit is contained in:
Jeffrey Pfau 2016-05-08 12:33:55 -07:00
parent e75b2928b1
commit 0e85739cd3
2 changed files with 16 additions and 2 deletions

View File

@ -37,6 +37,7 @@ Misc:
- Windows: Add native VDir support
- All: Add QUIET parameter to silence CMake
- GBA Video: Null renderer should return proper register values
- Libretro: Disable logging game errors, BIOS calls and stubs in release builds
0.4.0: (2016-02-02)
Features:

View File

@ -14,6 +14,8 @@
#include "gb/gb.h"
#endif
#ifdef M_CORE_GBA
#include "gba/bios.h"
#include "gba/core.h"
#include "gba/cheats.h"
#include "gba/core.h"
#include "gba/serialize.h"
@ -478,14 +480,25 @@ void GBARetroLog(struct mLogger* logger, int category, enum mLogLevel level, con
retroLevel = RETRO_LOG_WARN;
break;
case mLOG_INFO:
case mLOG_GAME_ERROR:
retroLevel = RETRO_LOG_INFO;
break;
case mLOG_DEBUG:
case mLOG_GAME_ERROR:
case mLOG_STUB:
#ifdef NDEBUG
return;
#else
retroLevel = RETRO_LOG_DEBUG;
break;
#endif
case mLOG_DEBUG:
retroLevel = RETRO_LOG_DEBUG;
break;
}
#ifdef NDEBUG
if (category == _mLOG_CAT_GBA_BIOS()) {
return;
}
#endif
logCallback(retroLevel, "%s: %s\n", mLogCategoryName(category), message);
}