mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
Move sofia logging to the core logging engine, add change sofia loglevel api and add sofia profile xxx siptrace on-off for TPORT_LOG
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12410 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -243,14 +243,23 @@ static void *SWITCH_THREAD_FUNC log_thread(switch_thread_t *t, void *obj)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define do_mods (LOG_QUEUE && THREAD_RUNNING)
|
||||
SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char *file, const char *func, int line,
|
||||
const char *userdata, switch_log_level_t level, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
switch_log_vprintf(channel, file, func, line, userdata, level, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
#define do_mods (LOG_QUEUE && THREAD_RUNNING)
|
||||
SWITCH_DECLARE(void) switch_log_vprintf(switch_text_channel_t channel, const char *file, const char *func, int line,
|
||||
const char *userdata, switch_log_level_t level, const char *fmt, va_list ap)
|
||||
{
|
||||
char *data = NULL;
|
||||
char *new_fmt = NULL;
|
||||
int ret = 0;
|
||||
va_list ap;
|
||||
FILE *handle;
|
||||
const char *filep = (file ? switch_cut_path(file) : "");
|
||||
const char *funcp = (func ? func : "");
|
||||
@@ -265,8 +274,6 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char
|
||||
|
||||
switch_assert(level < SWITCH_LOG_INVALID);
|
||||
|
||||
va_start(ap, fmt);
|
||||
|
||||
handle = switch_core_data_channel(channel);
|
||||
|
||||
if (channel != SWITCH_CHANNEL_ID_LOG_CLEAN) {
|
||||
@@ -285,7 +292,6 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char
|
||||
}
|
||||
|
||||
ret = switch_vasprintf(&data, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (ret == -1) {
|
||||
fprintf(stderr, "Memory Error\n");
|
||||
|
Reference in New Issue
Block a user