tweak the session level logging to work on the console too

This commit is contained in:
Anthony Minessale committed 2012-10-11 12:44:31 -05:00
1 parent a0049b2296
commit 4dae523bca
6 files changed
+29 -4

No files matched your search

@@ -5472,12 +5472,20 @@ SWITCH_STANDARD_API(escape_function)
#define UUID_LOGLEVEL_SYNTAX "<uuid> <level>"
SWITCH_STANDARD_API(uuid_loglevel)
{
switch_core_session_t *tsession = NULL;
switch_core_session_t *tsession = NULL, *bsession = NULL;
char *uuid = NULL, *text = NULL;
int b = 0;
if (!zstr(cmd) && (uuid = strdup(cmd))) {
if ((text = strchr(uuid, ' '))) {
*text++ = '\0';
if (!strncasecmp(text, "-b", 2)) {
b++;
if ((text = strchr(text, ' '))) {
*text++ = '\0';
}
}
}
}
@@ -5491,6 +5499,12 @@ SWITCH_STANDARD_API(uuid_loglevel)
} else if ((tsession = switch_core_session_locate(uuid))) {
switch_core_session_set_loglevel(tsession, level);
if (b && switch_core_session_get_partner(tsession, &bsession) == SWITCH_STATUS_SUCCESS) {
switch_core_session_set_loglevel(bsession, level);
switch_core_session_rwunlock(bsession);
}
stream->write_function(stream, "+OK\n");
switch_core_session_rwunlock(tsession);
} else {
+1 -1
View File
@@ -206,7 +206,7 @@ static switch_status_t switch_console_logger(const switch_log_node_t *node, swit
}
#endif
if (level > hard_log_level) {
if (level > hard_log_level && (node->slevel == SWITCH_LOG_UNINIT || level > node->slevel)) {
return SWITCH_STATUS_SUCCESS;
}