From d6d313884e70ec84f502d570e5cc627fe7360242 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 14 Apr 2006 03:04:53 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1148 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/libdingaling/src/libdingaling.c | 13 ++++++++++++- src/mod/endpoints/mod_dingaling/mod_dingaling.c | 7 ++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/libs/libdingaling/src/libdingaling.c b/libs/libdingaling/src/libdingaling.c index 7393343e3e..22bce68423 100644 --- a/libs/libdingaling/src/libdingaling.c +++ b/libs/libdingaling/src/libdingaling.c @@ -148,9 +148,20 @@ static char *cut_path(char *in) static void default_logger(char *file, const char *func, int line, int level, char *fmt, ...) { char *fp; + char data[1024]; + va_list ap; + fp = cut_path(file); - fprintf(globals.log_stream, "%s:%d %s() %s", file, line, func, fmt); + + va_start(ap, fmt); + + vsnprintf(data, sizeof(data), fmt, ap); + + fprintf(globals.log_stream, "%s:%d %s() %s", file, line, func, data); + + va_end(ap); + } static unsigned int next_id(void) diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index 5a7a080de2..0a93614bdc 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -155,7 +155,12 @@ static switch_status load_config(void); static void dl_logger(char *file, const char *func, int line, int level, char *fmt, ...) { - switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_DEBUG, fmt); + va_list ap; + va_start(ap, fmt); + + switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, SWITCH_LOG_DEBUG, ap); + + va_end(ap); } static void get_codecs(struct private_object *tech_pvt)