From e4d4bd355324af5a259aad107c59989680f22c14 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 15 Dec 2015 01:27:58 +0300 Subject: Enable writing to android or nacl log if enabled debug log in settings. --- src/logger.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/logger.cpp') diff --git a/src/logger.cpp b/src/logger.cpp index 5e0485803..01c471ecb 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -40,14 +40,28 @@ #include -#if defined(__ANDROID__) && defined(ANDROID_LOG) +#if defined(__ANDROID__) #include +#ifdef SPECIAL_LOGGING #define SPECIALLOG(x) __android_log_print(ANDROID_LOG_INFO, "manaplus", x); #define DSPECIALLOG(x) __android_log_print(ANDROID_LOG_VERBOSE, \ "manaplus", x); -#elif defined __native_client__ && defined(NACL_LOG) +#else // SPECIAL_LOGGING +#define SPECIALLOG(x) if (mDebugLog) \ + __android_log_print(ANDROID_LOG_INFO, "manaplus", x); +#define DSPECIALLOG(x) if (mDebugLog) \ + __android_log_print(ANDROID_LOG_VERBOSE, "manaplus", x); +#endif // SPECIAL_LOGGING +#elif defined __native_client__ +#ifdef SPECIAL_LOGGING #define SPECIALLOG(x) std::cerr << x; #define DSPECIALLOG(x) std::cerr << x; +#else // SPECIAL_LOGGING +#define SPECIALLOG(x) if (mDebugLog) \ + std::cerr << x; +#define DSPECIALLOG(x) if (mDebugLog) \ + std::cerr << x; +#endif // SPECIAL_LOGGING #else #define SPECIALLOG(x) #define DSPECIALLOG(x) -- cgit v1.2.3-60-g2f50