set session loglevel as well in fs_cli when doing 'console loglevel info' also now implies '/log info' locally

This commit is contained in:
Anthony Minessale 2012-04-02 11:58:00 -05:00
parent bc8cf0a0bf
commit b80a3a3439
1 changed files with 9 additions and 0 deletions

View File

@ -747,6 +747,8 @@ static const char *cli_usage =
static int process_command(esl_handle_t *handle, const char *cmd)
{
while (*cmd == ' ') cmd++;
if ((*cmd == '/' && cmd++) || !strncasecmp(cmd, "...", 3)) {
if (!strcasecmp(cmd, "help")) {
output_printf("%s", cli_usage);
@ -793,6 +795,13 @@ static int process_command(esl_handle_t *handle, const char *cmd)
} else {
char cmd_str[1024] = "";
const char *err = NULL;
if (!strncasecmp(cmd, "console loglevel ", 17)) {
snprintf(cmd_str, sizeof(cmd_str), "log %s", cmd + 17);
esl_send_recv(handle, cmd_str);
printf("%s\n", handle->last_sr_reply);
}
snprintf(cmd_str, sizeof(cmd_str), "api %s\nconsole_execute: true\n\n", cmd);
if (esl_send_recv(handle, cmd_str)) {
output_printf("Socket interrupted, bye!\n");