summaryrefslogtreecommitdiffstats
path: root/libmemunreachable
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-06-22 13:45:44 -0700
committerColin Cross <ccross@android.com>2017-06-22 13:46:56 -0700
commitf3ce8bc8aed76b07d928971e627e21c81be75e91 (patch)
tree2bf9b699f9269764059c657221bb4b8756b1a599 /libmemunreachable
parenta9939e9a23ea21f4f8dc69cf1dae8e95debadcfb (diff)
downloadcore-f3ce8bc8aed76b07d928971e627e21c81be75e91.tar.gz
core-f3ce8bc8aed76b07d928971e627e21c81be75e91.tar.bz2
core-f3ce8bc8aed76b07d928971e627e21c81be75e91.zip
libmemunreachable: turn off MEM_ALOGV messages
The move to async safe logging in I3d3b2111f6f6bf8a0d7039295d34d5168c191651 caused MEM_ALOGV messages to print even when NDEBUG was set. Test: builds Change-Id: Ibebe69d8c96f8f2556991c1eb5446a77782d43c7
Diffstat (limited to 'libmemunreachable')
-rw-r--r--libmemunreachable/log.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/libmemunreachable/log.h b/libmemunreachable/log.h
index 0f1bb8a08..44c5f853b 100644
--- a/libmemunreachable/log.h
+++ b/libmemunreachable/log.h
@@ -26,7 +26,18 @@
#define MEM_ALOGE(...) async_safe_format_log(ANDROID_LOG_ERROR, LOG_TAG, ##__VA_ARGS__)
#define MEM_ALOGW(...) async_safe_format_log(ANDROID_LOG_WARN, LOG_TAG, ##__VA_ARGS__)
#define MEM_ALOGI(...) async_safe_format_log(ANDROID_LOG_INFO, LOG_TAG, ##__VA_ARGS__)
-#define MEM_ALOGV(...) async_safe_format_log(ANDROID_LOG_VERBOSE, LOG_TAG, ##__VA_ARGS__)
+#define MEM_ALOGV_IMPL(...) async_safe_format_log(ANDROID_LOG_VERBOSE, LOG_TAG, ##__VA_ARGS__)
+
+#ifdef NDEBUG
+#define MEM_ALOGV(...) \
+ do { \
+ if (0) { \
+ MEM_ALOGV_IMPL(__VA_ARGS__); \
+ } \
+ } while (0)
+#else
+#define MEM_ALOGV(...) MEM_ALOGV_IMPL(__VA_ARGS__)
+#endif
#define MEM_LOG_ALWAYS_FATAL(...) async_safe_fatal(__VA_ARGS__)