From e06ad3e9e60eb0ac80a3f5fe8abae03698a18ea8 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 26 Apr 2024 14:12:23 -0700 Subject: [PATCH] Mild logging cleanup. --- native-activity/app/src/main/cpp/main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/native-activity/app/src/main/cpp/main.cpp b/native-activity/app/src/main/cpp/main.cpp index 76ed5f637..f1e8ff0b5 100644 --- a/native-activity/app/src/main/cpp/main.cpp +++ b/native-activity/app/src/main/cpp/main.cpp @@ -30,10 +30,13 @@ #include #include -#define LOGI(...) \ - ((void)__android_log_print(ANDROID_LOG_INFO, "native-activity", __VA_ARGS__)) -#define LOGW(...) \ - ((void)__android_log_print(ANDROID_LOG_WARN, "native-activity", __VA_ARGS__)) +#define LOG_TAG "native-activity" + +#define _LOG(priority, fmt, ...) \ + ((void)__android_log_print((priority), (LOG_TAG), (fmt)__VA_OPT__(, ) __VA_ARGS__)) + +#define LOGW(fmt, ...) _LOG(ANDROID_LOG_WARN, (fmt)__VA_OPT__(, ) __VA_ARGS__) +#define LOGI(fmt, ...) _LOG(ANDROID_LOG_INFO, (fmt)__VA_OPT__(, ) __VA_ARGS__) /** * Our saved state data.