diff options
author | Alexandre Elias <aelias@google.com> | 2011-03-29 16:24:45 -0700 |
---|---|---|
committer | Alexandre Elias <aelias@google.com> | 2011-03-29 16:24:45 -0700 |
commit | 412514ea60a707cefb42f2609a3422223bd86381 (patch) | |
tree | ce90502fb4cfd1686a089452a781e62279f08865 /include/cutils | |
parent | b40367e7bc3f89c3875d50b29fa98c3a541e33a3 (diff) | |
download | core-412514ea60a707cefb42f2609a3422223bd86381.tar.gz core-412514ea60a707cefb42f2609a3422223bd86381.tar.bz2 core-412514ea60a707cefb42f2609a3422223bd86381.zip |
Add ifndef guards to remaining logging macros.
Change-Id: I5fce9bffdb9e52d50059034fd1cc05ba7f0e3b87
Diffstat (limited to 'include/cutils')
-rw-r--r-- | include/cutils/log.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/cutils/log.h b/include/cutils/log.h index f60201701..42d738296 100644 --- a/include/cutils/log.h +++ b/include/cutils/log.h @@ -289,13 +289,17 @@ extern "C" { * It is NOT stripped from release builds. Note that the condition test * is -inverted- from the normal assert() semantics. */ +#ifndef LOG_ALWAYS_FATAL_IF #define LOG_ALWAYS_FATAL_IF(cond, ...) \ ( (CONDITION(cond)) \ ? ((void)android_printAssert(#cond, LOG_TAG, ## __VA_ARGS__)) \ : (void)0 ) +#endif +#ifndef LOG_ALWAYS_FATAL #define LOG_ALWAYS_FATAL(...) \ ( ((void)android_printAssert(NULL, LOG_TAG, ## __VA_ARGS__)) ) +#endif /* * Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that @@ -303,13 +307,21 @@ extern "C" { */ #if LOG_NDEBUG +#ifndef LOG_FATAL_IF #define LOG_FATAL_IF(cond, ...) ((void)0) +#endif +#ifndef LOG_FATAL #define LOG_FATAL(...) ((void)0) +#endif #else +#ifndef LOG_FATAL_IF #define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ## __VA_ARGS__) +#endif +#ifndef LOG_FATAL #define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__) +#endif #endif @@ -317,8 +329,10 @@ extern "C" { * Assertion that generates a log message when the assertion fails. * Stripped out of release builds. Uses the current LOG_TAG. */ +#ifndef LOG_ASSERT #define LOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__) //#define LOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond) +#endif // --------------------------------------------------------------------- @@ -377,18 +391,24 @@ typedef enum { } AndroidEventLogType; +#ifndef LOG_EVENT_INT #define LOG_EVENT_INT(_tag, _value) { \ int intBuf = _value; \ (void) android_btWriteLog(_tag, EVENT_TYPE_INT, &intBuf, \ sizeof(intBuf)); \ } +#endif +#ifndef LOG_EVENT_LONG #define LOG_EVENT_LONG(_tag, _value) { \ long long longBuf = _value; \ (void) android_btWriteLog(_tag, EVENT_TYPE_LONG, &longBuf, \ sizeof(longBuf)); \ } +#endif +#ifndef LOG_EVENT_STRING #define LOG_EVENT_STRING(_tag, _value) \ ((void) 0) /* not implemented -- must combine len with string */ +#endif /* TODO: something for LIST */ /* |