From: Yongjoo Ahn Date: Mon, 17 Apr 2023 06:46:19 +0000 (+0900) Subject: [agent] Change tizen log functions of ml-agent X-Git-Tag: accepted/tizen/unified/20230424.185349~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=243a11cba7e1b6159c840eae38f58b17c381bb7c;p=platform%2Fcore%2Fapi%2Fmachine-learning.git [agent] Change tizen log functions of ml-agent - Let ml-agent logs be more verbose in Tizen. Signed-off-by: Yongjoo Ahn --- diff --git a/daemon/includes/log.h b/daemon/includes/log.h index 840d239..186f5a9 100644 --- a/daemon/includes/log.h +++ b/daemon/includes/log.h @@ -21,10 +21,18 @@ #if defined(__TIZEN__) #include -#define _D(fmt, arg...) do { SLOGD(fmt, ##arg); } while (0) -#define _I(fmt, arg...) do { SLOGI(fmt, ##arg); } while (0) -#define _W(fmt, arg...) do { SLOGW(fmt, ##arg); } while (0) -#define _E(fmt, arg...) do { SLOGE(fmt, ##arg); } while (0) +#define AGENT_LOG_TAG "ml-agent" + +#define LOG_V(prio, tag, fmt, arg...) \ + ({ do { \ + dlog_print(prio, tag, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg);\ + } while (0); }) + +#define _D(fmt, arg...) LOG_V(DLOG_DEBUG, AGENT_LOG_TAG, fmt, ##arg) +#define _I(fmt, arg...) LOG_V(DLOG_INFO, AGENT_LOG_TAG, fmt, ##arg) +#define _W(fmt, arg...) LOG_V(DLOG_WARN, AGENT_LOG_TAG, fmt, ##arg) +#define _E(fmt, arg...) LOG_V(DLOG_ERROR, AGENT_LOG_TAG, fmt, ##arg) +#define _F(fmt, arg...) LOG_V(DLOG_FATAL, AGENT_LOG_TAG, fmt, ##arg) #else #include @@ -32,6 +40,7 @@ #define _I g_info #define _W g_warning #define _E g_critical +#define _F g_error #endif #endif /* __LOG_H__ */