log: modified qemu log format
authorJihye Won <jihye.won1@samsung.com>
Wed, 22 Jul 2015 04:24:55 +0000 (13:24 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Wed, 22 Jul 2015 07:49:45 +0000 (16:49 +0900)
- add a line number for logging

Change-Id: I79b80bc5b7513566d8a33b699fea22615e8781ab
Signed-off-by: Jihye Won <jihye.won1@samsung.com>
tizen/src/util/new_debug_ch.c
tizen/src/util/new_debug_ch.h

index 22d25a994c716761e8533c950693533c620e5378..8e5407e90a936d21de6e1649cfad0294a1619484 100644 (file)
@@ -42,6 +42,8 @@ static int fd = STDOUT_FILENO;
 
 static const char * const debug_classes[] =
         {"SEVR", "WARN", "INFO", "CONF", "FINE", "TRCE"};
+static const char const debug_classes_acronym[] =
+        {'S', 'W', 'I', 'C', 'F', 'T'};
 
 #define MAX_DEBUG_OPTIONS 256
 
@@ -282,7 +284,7 @@ static void debug_init(void)
 }
 
 int dbg_log(enum _debug_class cls, struct _debug_channel *channel,
-        const char *format, ...)
+        int line, const char *format, ...)
 {
     int ret = 0;
     int ret_write = 0;
@@ -296,8 +298,8 @@ int dbg_log(enum _debug_class cls, struct _debug_channel *channel,
     }
 
     ret += get_timeofday(buf_msg, sizeof(buf_msg));
-    ret += g_snprintf(buf_msg + ret, sizeof(buf_msg) - ret, "(%5d) [%4s:%10s] ",
-                qemu_get_thread_id(), debug_classes[cls], channel->name);
+    ret += g_snprintf(buf_msg + ret, sizeof(buf_msg) - ret, "|%5d|%1c|%10s|%4d|",
+                qemu_get_thread_id(), debug_classes_acronym[cls], channel->name, line);
 
     va_start(valist, format);
     ret += g_vsnprintf(buf_msg + ret, sizeof(buf_msg) - ret, format, valist);
index 6be8fb28065a742d0aee7d93382575cf1b41c593..b34f8ee2fa9c2c4656ed0f93cd6801d14b6492ff 100644 (file)
@@ -89,12 +89,12 @@ struct _debug_channel
         _DBG_LOG
 
 #define _DBG_LOG(args...) \
-        dbg_log(__dbcl, (struct _debug_channel *)(__dbch), args); } }while(0)
+        dbg_log(__dbcl, (struct _debug_channel *)(__dbch), __LINE__, args); } }while(0)
 
 extern unsigned char _dbg_get_channel_flags(struct _debug_channel *channel);
 
 extern int dbg_log(enum _debug_class cls, struct _debug_channel *ch,
-        const char *format, ...);
+        int line, const char *format, ...);
 
 #ifndef LOG_SEVERE
 #define LOG_SEVERE              __DPRINTF(_SEVERE,&_dbch_)