log: check tdm environment value only init
[platform/core/uifw/libtdm.git] / include / tdm_log.h
index 1cab32d..de56386 100644 (file)
@@ -9,7 +9,7 @@
  *          Taeheon Kim <th908.kim@samsung.com>,
  *          YoungJun Cho <yj44.cho@samsung.com>,
  *          SooChan Lim <sc1.lim@samsung.com>,
- *          Boram Park <sc1.lim@samsung.com>
+ *          Boram Park <boram1288.park@samsung.com>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the
@@ -66,9 +66,12 @@ enum {
 
 void tdm_log_enable_color(unsigned int enable);
 void tdm_log_enable_dlog(unsigned int enable);
-void tdm_log_enable_debug(unsigned int enable);
 void tdm_log_set_debug_level(int level);
+void tdm_log_set_assert_level(int level);
+void tdm_log_set_path(const char *path);
+void tdm_log_printf(int level, const char *fmt, ...);
 void tdm_log_print(int level, const char *fmt, ...);
+void tdm_log_reset(void);
 
 extern unsigned int tdm_log_debug_level;
 
@@ -77,7 +80,7 @@ extern unsigned int tdm_log_debug_level;
                if (tdm_log_debug_level >= TDM_LOG_LEVEL_DBG) { \
                        struct timespec ts; \
                        clock_gettime(CLOCK_MONOTONIC, &ts); \
-                       tdm_log_print(TDM_LOG_LEVEL_DBG, "[%5d.%06d][%d][%s %d]"fmt"\n", \
+                       tdm_log_print(TDM_LOG_LEVEL_DBG, "[%5d.%06d][%d][%s %d]"fmt, \
                                                  (int)ts.tv_sec, (int)ts.tv_nsec / 1000, \
                                                  (int)syscall(SYS_gettid), __FUNCTION__, __LINE__, ##args);  \
                } \
@@ -87,7 +90,7 @@ extern unsigned int tdm_log_debug_level;
                if (tdm_log_debug_level >= TDM_LOG_LEVEL_INFO) { \
                        struct timespec ts; \
                        clock_gettime(CLOCK_MONOTONIC, &ts); \
-                       tdm_log_print(TDM_LOG_LEVEL_INFO, "[%5d.%06d][%d][%s %d]"fmt"\n", \
+                       tdm_log_print(TDM_LOG_LEVEL_INFO, "[%5d.%06d][%d][%s %d]"fmt, \
                                                  (int)ts.tv_sec, (int)ts.tv_nsec / 1000, \
                                                  (int)syscall(SYS_gettid), __FUNCTION__, __LINE__, ##args);  \
                } \
@@ -97,7 +100,7 @@ extern unsigned int tdm_log_debug_level;
                if (tdm_log_debug_level >= TDM_LOG_LEVEL_WRN) { \
                        struct timespec ts; \
                        clock_gettime(CLOCK_MONOTONIC, &ts); \
-                       tdm_log_print(TDM_LOG_LEVEL_WRN, "[%5d.%06d][%d][%s %d]"fmt"\n", \
+                       tdm_log_print(TDM_LOG_LEVEL_WRN, "[%5d.%06d][%d][%s %d]"fmt, \
                                                  (int)ts.tv_sec, (int)ts.tv_nsec / 1000, \
                                                  (int)syscall(SYS_gettid), __FUNCTION__, __LINE__, ##args);  \
                } \
@@ -107,12 +110,21 @@ extern unsigned int tdm_log_debug_level;
                if (tdm_log_debug_level >= TDM_LOG_LEVEL_ERR) { \
                        struct timespec ts; \
                        clock_gettime(CLOCK_MONOTONIC, &ts); \
-                       tdm_log_print(TDM_LOG_LEVEL_ERR, "[%5d.%06d][%d][%s %d]"fmt"\n", \
+                       tdm_log_print(TDM_LOG_LEVEL_ERR, "[%5d.%06d][%d][%s %d]"fmt, \
                                                  (int)ts.tv_sec, (int)ts.tv_nsec / 1000, \
                                                  (int)syscall(SYS_gettid), __FUNCTION__, __LINE__, ##args);  \
                } \
        } while (0)
 
+#define TDM_NEVER_GET_HERE() TDM_WRN("** NEVER GET HERE **")
+#define TDM_DEPRECATED(str) \
+       do { \
+               if (str) \
+                       TDM_WRN("** DEPRECATED: %s **", str); \
+               else \
+                       TDM_WRN("** DEPRECATED **"); \
+       } while(0)
+
 #ifdef __cplusplus
 }
 #endif