put math patch back

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16423 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Brian West
2010-01-20 19:19:48 +00:00
parent d186928224
commit e435cd8271
9 changed files with 128 additions and 7 deletions

View File

@@ -339,6 +339,14 @@ SWITCH_DECLARE(void) switch_log_vprintf(switch_text_channel_t channel, const cha
#else
const char *extra_fmt = "%s [%s] %s:%d%c%s";
#endif
switch_log_level_t limit_level = runtime.hard_log_level;
if (channel == SWITCH_CHANNEL_ID_SESSION && userdata) {
switch_core_session_t *session = (switch_core_session_t*)userdata;
if (limit_level < session->loglevel) {
limit_level = session->loglevel;
}
}
if (level > 100) {
if ((uint32_t)(level - 100) > runtime.debug_level) {
@@ -348,7 +356,7 @@ SWITCH_DECLARE(void) switch_log_vprintf(switch_text_channel_t channel, const cha
level = 7;
}
if (level > runtime.hard_log_level) {
if (level > limit_level) {
return;
}
@@ -466,7 +474,11 @@ SWITCH_DECLARE(void) switch_log_vprintf(switch_text_channel_t channel, const cha
node->content = content;
node->timestamp = now;
node->channel = channel;
node->userdata = !zstr(userdata) ? strdup(userdata) : NULL;
if (channel == SWITCH_CHANNEL_ID_SESSION) {
node->userdata = userdata ? strdup(switch_core_session_get_uuid((switch_core_session_t*)userdata)) : NULL;
} else {
node->userdata = !zstr(userdata) ? strdup(userdata) : NULL;
}
if (switch_queue_trypush(LOG_QUEUE, node) != SWITCH_STATUS_SUCCESS) {
switch_log_node_free(&node);