FS-10210: [mod_console] add support for uuid config param and 'console uuid' api command

This commit is contained in:
Mike Jerris 2017-04-10 15:11:44 -05:00
parent 33a059ec72
commit e1be97337d
1 changed files with 15 additions and 0 deletions

View File

@ -280,6 +280,7 @@ SWITCH_STANDARD_API(console_api_function)
"--------------------------------------------------------------------------------\n"
"console help\n"
"console loglevel [[0-7] | <loglevel_string>]\n"
"console uuid [on|off|toggle]\n"
"console colorize [on|off|toggle]\n" "--------------------------------------------------------------------------------\n";
const char *loglevel_usage_string = "USAGE:\n"
"--------------------------------------------------------------------------------\n"
@ -349,6 +350,20 @@ SWITCH_STANDARD_API(console_api_function)
}
stream->write_function(stream, "+OK console color %s\n", COLORIZE ? "enabled" : "disabled");
} else if (!strcasecmp(argv[0], "uuid")) {
if (argc > 1) {
if (!strcasecmp(argv[1], "toggle")) {
if (log_uuid) {
log_uuid = SWITCH_FALSE;
} else {
log_uuid = SWITCH_TRUE;
}
} else {
log_uuid = switch_true(argv[1]);
}
}
stream->write_function(stream, "+OK console uuid %s\n", log_uuid ? "enabled" : "disabled");
} else { /* if (!strcasecmp(argv[0], "help")) { */
stream->write_function(stream, "%s", usage_string);
}