mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
GLideNHQ: Output debug messages to android log instead of file.
This commit is contained in:
parent
037d2d8e1d
commit
076f0c8e1b
|
@ -28,6 +28,34 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.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()
|
TxDbg::TxDbg()
|
||||||
{
|
{
|
||||||
_level = DBG_LEVEL;
|
_level = DBG_LEVEL;
|
||||||
|
@ -53,12 +81,12 @@ TxDbg::~TxDbg()
|
||||||
void
|
void
|
||||||
TxDbg::output(const int level, const wchar_t *format, ...)
|
TxDbg::output(const int level, const wchar_t *format, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
|
||||||
wchar_t newformat[4095];
|
|
||||||
|
|
||||||
if (level > _level)
|
if (level > _level)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
va_list args;
|
||||||
|
wchar_t newformat[4095];
|
||||||
|
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
swprintf(newformat, 4095, L"%d:\t", level);
|
swprintf(newformat, 4095, L"%d:\t", level);
|
||||||
wcscat(newformat, format);
|
wcscat(newformat, format);
|
||||||
|
@ -70,3 +98,4 @@ TxDbg::output(const int level, const wchar_t *format, ...)
|
||||||
#endif
|
#endif
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
#endif // ANDROID
|
||||||
|
|
Loading…
Reference in New Issue
Block a user