提交 4622a7a1 authored 作者: Anthony Minessale's avatar Anthony Minessale

add ifdef

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14648 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 c10d8e37
...@@ -334,8 +334,11 @@ SWITCH_DECLARE(void) switch_log_vprintf(switch_text_channel_t channel, const cha ...@@ -334,8 +334,11 @@ SWITCH_DECLARE(void) switch_log_vprintf(switch_text_channel_t channel, const cha
char *content = NULL; char *content = NULL;
switch_time_t now = switch_micro_time_now(); switch_time_t now = switch_micro_time_now();
uint32_t len; uint32_t len;
//const char *extra_fmt = "%s [%s] %s:%d %s()%c%s"; #ifdef SWITCH_FUNC_IN_LOG
const char *extra_fmt = "%s [%s] %s:%d %s()%c%s";
#else
const char *extra_fmt = "%s [%s] %s:%d%c%s"; const char *extra_fmt = "%s [%s] %s:%d%c%s";
#endif
if (level > runtime.hard_log_level) { if (level > runtime.hard_log_level) {
return; return;
...@@ -356,11 +359,19 @@ SWITCH_DECLARE(void) switch_log_vprintf(switch_text_channel_t channel, const cha ...@@ -356,11 +359,19 @@ SWITCH_DECLARE(void) switch_log_vprintf(switch_text_channel_t channel, const cha
//switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm); //switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
//len = (uint32_t) (strlen(extra_fmt) + strlen(date) + strlen(filep) + 32 + strlen(funcp) + strlen(fmt)); #ifdef SWITCH_FUNC_IN_LOG
len = (uint32_t) (strlen(extra_fmt) + strlen(date) + strlen(filep) + 32 + strlen(funcp) + strlen(fmt));
#else
len = (uint32_t) (strlen(extra_fmt) + strlen(date) + strlen(filep) + 32 + strlen(fmt)); len = (uint32_t) (strlen(extra_fmt) + strlen(date) + strlen(filep) + 32 + strlen(fmt));
#endif
new_fmt = malloc(len + 1); new_fmt = malloc(len + 1);
switch_assert(new_fmt); switch_assert(new_fmt);
#ifdef SWITCH_FUNC_IN_LOG
switch_snprintf(new_fmt, len, extra_fmt, date, switch_log_level2str(level), filep, line, funcp, 128, fmt);
#else
switch_snprintf(new_fmt, len, extra_fmt, date, switch_log_level2str(level), filep, line, 128, fmt); switch_snprintf(new_fmt, len, extra_fmt, date, switch_log_level2str(level), filep, line, 128, fmt);
#endif
fmt = new_fmt; fmt = new_fmt;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论