Commit 821b2e67 authored by Tristan Matthews's avatar Tristan Matthews

* #27528: logger: fix logging for format strings with args

Broken in commit 5b53f2f9
parent 5b53f2f9
......@@ -47,7 +47,7 @@ void setDebugMode(bool);
bool getDebugMode();
};
#define LOG_FORMAT(M) "%s:%d:0x%x: " M, FILE_NAME, __LINE__, (unsigned long) pthread_self() & 0xffff
#define LOG_FORMAT(M, ...) "%s:%d:0x%x: " M, FILE_NAME, __LINE__, (unsigned long) pthread_self() & 0xffff, ##__VA_ARGS__
#ifndef __ANDROID__
......@@ -56,7 +56,7 @@ bool getDebugMode();
#define WARN(M, ...) LOGGER(M, LOG_WARNING, ##__VA_ARGS__)
#define INFO(M, ...) LOGGER(M, LOG_INFO, ##__VA_ARGS__)
#define DEBUG(M, ...) LOGGER(M, LOG_DEBUG, ##__VA_ARGS__)
#define LOGGER(M, LEVEL, ...) Logger::log(LEVEL, LOG_FORMAT(M), ##__VA_ARGS__)
#define LOGGER(M, LEVEL, ...) Logger::log(LEVEL, LOG_FORMAT(M, ##__VA_ARGS__))
#else /* ANDROID */
......@@ -71,7 +71,7 @@ bool getDebugMode();
#define WARN(M, ...) LOGGER(M, ANDROID_LOG_WARN, ##__VA_ARGS__)
#define INFO(M, ...) LOGGER(M, ANDROID_LOG_INFO, ##__VA_ARGS__)
#define DEBUG(M, ...) LOGGER(M, ANDROID_LOG_DEBUG, ##__VA_ARGS__)
#define LOGGER(M, LEVEL, ...) __android_log_print(LEVEL, APP_NAME, LOG_FORMAT(M), ##__VA_ARGS__)
#define LOGGER(M, LEVEL, ...) __android_log_print(LEVEL, APP_NAME, LOG_FORMAT(M, ##__VA_ARGS__))
#endif /* ANDROID */
#define BLACK "\033[22;30m"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment