add fsctl loglevel [<level>] fsctl command

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5790 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-10-03 23:43:01 +00:00
parent e44ad9588c
commit 1667112b3b
8 changed files with 39 additions and 8 deletions
+13 -1
View File
@@ -623,7 +623,7 @@ SWITCH_DECLARE(switch_time_t) switch_core_uptime(void)
return switch_time_now() - runtime.initiated;
}
SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, uint32_t * val)
SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, int32_t * val)
{
if (switch_test_flag((&runtime), SCF_SHUTTING_DOWN)) {
return -1;
@@ -646,6 +646,18 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, uint32
case SCSC_CHECK_RUNNING:
*val = runtime.running;
break;
case SCSC_LOGLEVEL:
if (*val > -1) {
printf("WTF %d\n", *val);
runtime.hard_log_level = *val;
}
if (runtime.hard_log_level > SWITCH_LOG_CONSOLE) {
printf("WTF %d\n", *val);
runtime.hard_log_level = SWITCH_LOG_CONSOLE;
}
*val = runtime.hard_log_level;
break;
}
return 0;