mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-05-02 18:24:49 +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 <fstream>
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
|
||||
namespace Log {
|
||||
// Our logger class
|
||||
template <bool enabled>
|
||||
|
@ -11,8 +15,12 @@ namespace Log {
|
|||
if constexpr (!enabled) return;
|
||||
|
||||
std::va_list args;
|
||||
va_start(args, fmt);
|
||||
std::vprintf(fmt, args);
|
||||
va_start(args, fmt);
|
||||
#ifdef __ANDROID__
|
||||
__android_log_vprint(ANDROID_LOG_DEFAULT, "Panda3DS", fmt, args);
|
||||
#else
|
||||
std::vprintf(fmt, args);
|
||||
#endif
|
||||
va_end(args);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue