From 9c7c77e259a70817aacbbe1711f1bfbd01c33694 Mon Sep 17 00:00:00 2001 From: "Konstantin S. Vishnivetsky" Date: Thu, 6 Oct 2022 13:12:05 +0400 Subject: [PATCH] [fs_cli] Add: -s key adding log events filter UUID on fs_cli startup * Add: -s key adding log events filter UUID on fs_cli startup * Add: long option --set-log-uuid --- libs/esl/fs_cli.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c index 76e85b450d..973df741e0 100644 --- a/libs/esl/fs_cli.c +++ b/libs/esl/fs_cli.c @@ -632,7 +632,8 @@ static const char *usage_str = " -b, --batchmode Batch mode\n" " -t, --timeout Timeout for API commands (in milliseconds)\n" " -T, --connect-timeout Timeout for socket connection (in milliseconds)\n" - " -n, --no-color Disable color\n\n"; + " -n, --no-color Disable color\n" + " -s, --set-log-uuid Set UUID to filter log events\n\n"; static int usage(char *name){ printf(usage_str, name); @@ -1468,6 +1469,7 @@ int main(int argc, char *argv[]) {"reconnect", 0, 0, 'R'}, {"timeout", 1, 0, 't'}, {"connect-timeout", 1, 0, 'T'}, + {"set-log-uuid", 1, 0, 's'}, {0, 0, 0, 0} }; char temp_host[128]; @@ -1483,6 +1485,7 @@ int main(int argc, char *argv[]) int argv_exec = 0; char argv_command[1024] = ""; char argv_loglevel[127] = ""; + char argv_filter_uuid[64] = {0}; int argv_log_uuid = 0; int argv_log_uuid_short = 0; int argv_quiet = 0; @@ -1539,7 +1542,7 @@ int main(int argc, char *argv[]) esl_global_set_default_logger(6); /* default debug level to 6 (info) */ for(;;) { int option_index = 0; - opt = getopt_long(argc, argv, "H:P:u:p:d:x:l:USt:T:qQrRhib?n", options, &option_index); + opt = getopt_long(argc, argv, "H:P:u:p:d:x:l:USt:T:qQrRhib?ns:", options, &option_index); if (opt == -1) break; switch (opt) { case 'H': @@ -1614,6 +1617,11 @@ int main(int argc, char *argv[]) case 'T': connect_timeout = atoi(optarg); break; + case 's': + esl_set_string(argv_filter_uuid, optarg); + filter_uuid = strdup(argv_filter_uuid); + break; + case 'h': case '?': print_banner(stdout, is_color);