From: Jihye Won Date: Wed, 22 Jul 2015 04:24:55 +0000 (+0900) Subject: log: modified qemu log format X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~286^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d750b1d41ffcc2f2198dc5fc45aff593d316a31;p=sdk%2Femulator%2Fqemu.git log: modified qemu log format - add a line number for logging Change-Id: I79b80bc5b7513566d8a33b699fea22615e8781ab Signed-off-by: Jihye Won --- diff --git a/tizen/src/util/new_debug_ch.c b/tizen/src/util/new_debug_ch.c index 22d25a994c..8e5407e90a 100644 --- a/tizen/src/util/new_debug_ch.c +++ b/tizen/src/util/new_debug_ch.c @@ -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); diff --git a/tizen/src/util/new_debug_ch.h b/tizen/src/util/new_debug_ch.h index 6be8fb2806..b34f8ee2fa 100644 --- a/tizen/src/util/new_debug_ch.h +++ b/tizen/src/util/new_debug_ch.h @@ -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_)