1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

GLideNHQ: Output debug messages to android log instead of file.

This commit is contained in:
Sergey Lipskiy 2015-05-26 23:38:58 +06:00
parent 037d2d8e1d
commit 076f0c8e1b

View File

@ -28,6 +28,34 @@
#include <stdarg.h>
#include <stdio.h>
#ifdef ANDROID
#include <android/log.h>
TxDbg::TxDbg()
{
_level = DBG_LEVEL;
}
TxDbg::~TxDbg()
{}
void
TxDbg::output(const int level, const wchar_t *format, ...)
{
if (level > _level)
return;
char fmt[2048];
wcstombs(fmt, format, 2048);
va_list ap;
va_start(ap, format);
__android_log_vprint(ANDROID_LOG_DEBUG, "GLideN64", fmt, ap);
va_end(ap);
}
#else // ANDROID
TxDbg::TxDbg()
{
_level = DBG_LEVEL;
@ -53,12 +81,12 @@ TxDbg::~TxDbg()
void
TxDbg::output(const int level, const wchar_t *format, ...)
{
va_list args;
wchar_t newformat[4095];
if (level > _level)
return;
va_list args;
wchar_t newformat[4095];
va_start(args, format);
swprintf(newformat, 4095, L"%d:\t", level);
wcscat(newformat, format);
@ -70,3 +98,4 @@ TxDbg::output(const int level, const wchar_t *format, ...)
#endif
va_end(args);
}
#endif // ANDROID