diff options
| author | 2024-05-01 01:07:49 +0000 | |
|---|---|---|
| committer | 2024-05-01 01:07:49 +0000 | |
| commit | bbdf5f0690aefbdeccb87118527c08cd45c554cb (patch) | |
| tree | b07c0201049a7732d11c9338893934797337df23 | |
| parent | dd47876f7f6bbf4abf2c7ea5825b87af9de0e234 (diff) | |
| parent | 90bfb135f20c668e7628273c57c1698cf491b835 (diff) | |
Merge "Enable liblog_stub to work with variable tags" into main am: 90bfb135f2
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3068484
Change-Id: I2261ede91ad6022cbf3c811d2d08209b19d752cb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | libs/binder/liblog_stub/include/log/log.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libs/binder/liblog_stub/include/log/log.h b/libs/binder/liblog_stub/include/log/log.h index 91c9632c1b..dad0020ace 100644 --- a/libs/binder/liblog_stub/include/log/log.h +++ b/libs/binder/liblog_stub/include/log/log.h @@ -54,16 +54,16 @@ int __android_log_print(int prio, const char* tag, const char* fmt, ...) #define IF_ALOGW() IF_ALOG(LOG_WARN, LOG_TAG) #define IF_ALOGE() IF_ALOG(LOG_ERROR, LOG_TAG) -#define ALOG(priority, tag, fmt, ...) \ - do { \ - if (false)[[/*VERY*/ unlikely]] { /* ignore unused __VA_ARGS__ */ \ - std::fprintf(stderr, fmt __VA_OPT__(, ) __VA_ARGS__); \ - } \ - IF_ALOG(priority, tag) { \ - __android_log_print(ANDROID_##priority, tag, \ - tag ": " fmt "\n" __VA_OPT__(, ) __VA_ARGS__); \ - } \ - if constexpr (ANDROID_##priority == ANDROID_LOG_FATAL) std::abort(); \ +#define ALOG(priority, tag, fmt, ...) \ + do { \ + if (false)[[/*VERY*/ unlikely]] { /* ignore unused __VA_ARGS__ */ \ + std::fprintf(stderr, fmt __VA_OPT__(, ) __VA_ARGS__); \ + } \ + IF_ALOG(priority, tag) { \ + __android_log_print(ANDROID_##priority, tag, "%s: " fmt "\n", \ + (tag)__VA_OPT__(, ) __VA_ARGS__); \ + } \ + if constexpr (ANDROID_##priority == ANDROID_LOG_FATAL) std::abort(); \ } while (false) #define ALOGV(...) ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__) #define ALOGD(...) ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__) |