mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-05-03 02:34:48 +12:00
Native logger
This commit is contained in:
parent
c19c95e76f
commit
130640152c
1 changed files with 10 additions and 2 deletions
|
@ -2,6 +2,10 @@
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
#ifdef __ANDROID__
|
||||||
|
#include <android/log.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Log {
|
namespace Log {
|
||||||
// Our logger class
|
// Our logger class
|
||||||
template <bool enabled>
|
template <bool enabled>
|
||||||
|
@ -11,8 +15,12 @@ namespace Log {
|
||||||
if constexpr (!enabled) return;
|
if constexpr (!enabled) return;
|
||||||
|
|
||||||
std::va_list args;
|
std::va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
std::vprintf(fmt, args);
|
#ifdef __ANDROID__
|
||||||
|
__android_log_vprint(ANDROID_LOG_DEFAULT, "Panda3DS", fmt, args);
|
||||||
|
#else
|
||||||
|
std::vprintf(fmt, args);
|
||||||
|
#endif
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue