tracing: introduce _W warning macro 91/205691/1
authorMichal Bloch <m.bloch@samsung.com>
Wed, 8 May 2019 10:48:11 +0000 (12:48 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Wed, 8 May 2019 10:48:11 +0000 (12:48 +0200)
Change-Id: If8dd95102ecb8d251c6de2648c0e10f858c70a61
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/common/trace.h

index f09b43d..9cdf4b2 100644 (file)
@@ -60,6 +60,16 @@ extern enum log_type logtype;
        }                                       \
 } while (0)
 
+#define _W(fmt, arg...) do { \
+       switch(logtype) { \
+       case LOG_TYPE_DLOG: \
+               LOGW(fmt, ##arg); \
+               break; \
+       default: \
+               log_write(LOG_WARNING, fmt, ##arg); \
+       } \
+} while (0)
+
 #define _D(fmt, arg...) do {                           \
        switch (logtype) {                              \
        case LOG_TYPE_DLOG:                             \
@@ -81,6 +91,7 @@ extern enum log_type logtype;
 } while (0)
 
 #define _SE(fmt, arg...) SECURE_LOGE(fmt, ##arg)
+#define _SW(fmt, arg...) SECURE_LOGW(fmt, ##arg)
 #define _SD(fmt, arg...) SECURE_LOGD(fmt, ##arg)
 #define _SI(fmt, arg...) SECURE_LOGI(fmt, ##arg)