diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c index b3e38b3..ce34ac2 100644 --- a/src/bankd/bankd_main.c +++ b/src/bankd/bankd_main.c @@ -271,6 +271,7 @@ static void printf_help() printf( " -h --help Print this help message\n" " -V --version Print the version of the program\n" +" -d --debug option Enable debug logging (e.g. DMAIN:DST2)\n" " -i --server-host A.B.C.D remsim-server IP address (default: 127.0.0.1)\n" " -p --server-port <1-65535> remsim-server TCP port (default: 9998)\n" " -b --bank-id <1-65535> Bank Identifier of this SIM bank (default: 1)\n" @@ -292,6 +293,7 @@ void handle_options(int argc, char **argv) static const struct option long_options[] = { { "help", 0, 0, 'h' }, { "version", 0, 0, 'V' }, + { "debug", 1, 0, 'd' }, { "server-host", 1, 0, 'i' }, { "server-port", 1, 0, 'p' }, { "bank-id", 1, 0, 'b' }, @@ -302,7 +304,7 @@ void handle_options(int argc, char **argv) { 0, 0, 0, 0 } }; - c = getopt_long(argc, argv, "hVi:o:b:n:N:I:P:", long_options, &option_index); + c = getopt_long(argc, argv, "hVd:i:o:b:n:N:I:P:", long_options, &option_index); if (c == -1) break; @@ -315,6 +317,9 @@ void handle_options(int argc, char **argv) printf("osmo-remsim-bankd version %s\n", VERSION); exit(0); break; + case 'd': + log_parse_category_mask(osmo_stderr_target, optarg); + break; case 'i': g_bankd->srvc.server_host = optarg; break; diff --git a/src/client/remsim_client_main.c b/src/client/remsim_client_main.c index 6587e6b..bc916b9 100644 --- a/src/client/remsim_client_main.c +++ b/src/client/remsim_client_main.c @@ -24,6 +24,7 @@ static void printf_help() printf( " -h --help Print this help message\n" " -v --version Print program version\n" + " -d --debug option Enable debug logging (e.g. DMAIN:DST2)\n" " -i --server-ip A.B.C.D remsim-server IP address\n" " -p --server-port 13245 remsim-server TCP port\n" " -c --client-id <0-65535> RSPRO ClientId of this client\n" @@ -50,6 +51,7 @@ static void handle_options(struct client_config *cfg, int argc, char **argv) static const struct option long_options[] = { { "help", 0, 0, 'h' }, { "version", 0, 0, 'v' }, + { "debug", 1, 0, 'd' }, { "server-ip", 1, 0, 'i' }, { "server-port", 1, 0, 'p' }, { "client-id", 1, 0, 'c' }, @@ -68,7 +70,7 @@ static void handle_options(struct client_config *cfg, int argc, char **argv) { 0, 0, 0, 0 } }; - c = getopt_long(argc, argv, "hvi:p:c:n:e:" + c = getopt_long(argc, argv, "hvd:i:p:c:n:e:" #ifdef USB_SUPPORT "V:P:C:I:S:A:H:" #endif @@ -86,6 +88,9 @@ static void handle_options(struct client_config *cfg, int argc, char **argv) printf("osmo-remsim-client version %s\n", VERSION); exit(0); break; + case 'd': + log_parse_category_mask(osmo_stderr_target, optarg); + break; case 'i': osmo_talloc_replace_string(cfg, &cfg->server_host, optarg); break; diff --git a/src/server/remsim_server.c b/src/server/remsim_server.c index 9d3268f..be853a1 100644 --- a/src/server/remsim_server.c +++ b/src/server/remsim_server.c @@ -33,6 +33,7 @@ static void print_help() printf( " Some useful help...\n" " -h --help This text\n" " -V --version Print version of the program\n" + " -d --debug option Enable debug logging (e.g. DMAIN:DST2)\n" ); } @@ -43,10 +44,11 @@ static void handle_options(int argc, char **argv) static struct option long_options[] = { { "help", 0, 0, 'h' }, { "version", 0, 0, 'V' }, + { "debug", 1, 0, 'd' }, {0, 0, 0, 0} }; - c = getopt_long(argc, argv, "hV", long_options, &option_index); + c = getopt_long(argc, argv, "hVd:", long_options, &option_index); if (c == -1) break; @@ -55,6 +57,9 @@ static void handle_options(int argc, char **argv) print_help(); exit(0); break; + case 'd': + log_parse_category_mask(osmo_stderr_target, optarg); + break; case 'V': printf("osmo-resmim-server version %s\n", VERSION); exit(0);