summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
eb4eec8)
When the dlog is enabled, calling fprintf() is unnecessary.
And, this patch removes the unnecessary definition of the do-while loop.
Change-Id: Ibe376ba9177d425bf5902d6e3949e653c4c297f4
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-# define _ERR(fmt, arg...) \
- do { fprintf(stderr, "appcore: "fmt"\n", ##arg); } while (0)
-
-# define _INFO(fmt, arg...) \
- do { fprintf(stdout, fmt"\n", ##arg); } while (0)
-
-# define _DBG(fmt, arg...) \
+#define _ERR(fmt, arg...) fprintf(stderr, "appcore: "fmt"\n", ##arg)
+#define _INFO(fmt, arg...) fprintf(stdout, fmt"\n", ##arg)
+#define _DBG(fmt, arg...) \
do { \
if (getenv("APPCORE_DEBUG")) { \
fprintf(stdout, fmt"\n", ##arg); \
} \
} while (0)
#else
do { \
if (getenv("APPCORE_DEBUG")) { \
fprintf(stdout, fmt"\n", ##arg); \
} \
} while (0)
#else
-# define _ERR(fmt, arg...) \
- do { \
- fprintf(stderr, "appcore: "fmt"\n", ##arg); \
- LOGE(fmt, ##arg); \
- } while (0)
-# define _INFO(...) LOGI(__VA_ARGS__)
-# define _DBG(...) LOGD(__VA_ARGS__)
+#define _ERR(fmt, arg...) LOGE(fmt, ##arg)
+#define _INFO(...) LOGI(__VA_ARGS__)
+#define _DBG(...) LOGD(__VA_ARGS__)
#endif
#define _warn_if(expr, fmt, arg...) do { \
#endif
#define _warn_if(expr, fmt, arg...) do { \