android logging

This commit is contained in:
Jeff Becker 2018-08-06 14:35:00 +10:00
parent fe489b0280
commit ec6b468b44

View File

@ -11,6 +11,9 @@
#define VC_EXTRALEAN #define VC_EXTRALEAN
#include <windows.h> #include <windows.h>
#endif #endif
#ifdef ANDROID
#include <android/log.h>
#endif
namespace llarp namespace llarp
{ {
@ -103,9 +106,16 @@ namespace llarp
ss << (char)27 << "[0;0m"; ss << (char)27 << "[0;0m";
{ {
std::unique_lock< std::mutex > lock(_glog.access); std::unique_lock< std::mutex > lock(_glog.access);
#ifdef ANDROID
__android_log_write(ANDROID_LOG_INFO,
"LOKINET"
"%s",
ss.str());
#else
_glog.out << ss.str() << std::endl; _glog.out << ss.str() << std::endl;
#ifdef SHADOW_TESTNET #ifdef SHADOW_TESTNET
_glog.out << "\n" << std::flush; _glog.out << "\n" << std::flush;
#endif
#endif #endif
} }
} }