diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-12-15 01:27:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-15 01:28:46 +0300 |
commit | e4d4bd355324af5a259aad107c59989680f22c14 (patch) | |
tree | 3eaac8b4640d0fef2085bdbf7bead5423e00ea64 | |
parent | 1d1ddce1a81cdf65d765444685313afc4b161e5f (diff) | |
download | mv-e4d4bd355324af5a259aad107c59989680f22c14.tar.gz mv-e4d4bd355324af5a259aad107c59989680f22c14.tar.bz2 mv-e4d4bd355324af5a259aad107c59989680f22c14.tar.xz mv-e4d4bd355324af5a259aad107c59989680f22c14.zip |
Enable writing to android or nacl log if enabled debug log in settings.
-rw-r--r-- | src/localconsts.h | 7 | ||||
-rw-r--r-- | src/logger.cpp | 18 |
2 files changed, 18 insertions, 7 deletions
diff --git a/src/localconsts.h b/src/localconsts.h index 28d6ab5bc..013f11507 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -181,11 +181,8 @@ // #define DEBUG_DUMP_LEAKS1 1 // #define DEBUG_SDLFONT 1 -// Android logging -// #define ANDROID_LOG 1 - -// nacl logging -#define NACL_LOG 1 +// android or nacl logging +// #define SPECIAL_LOGGING 1 // profiler // #define USE_PROFILER 1 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 <sstream> -#if defined(__ANDROID__) && defined(ANDROID_LOG) +#if defined(__ANDROID__) #include <android/log.h> +#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) |