summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-02-26 17:53:53 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2013-02-26 17:53:53 +0100
commitfdf73eb40f7ee6aaf0f50b3f60c6f054d63a49bf (patch)
treec04c6152427e7895d31161cd8b474ef687facf7c
parent2cfeba7ddbd1dc89c56fe8f3896fbf492354d1a0 (diff)
Add loglevel command to transceiver application
-rw-r--r--src/host/layer23/src/transceiver/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/host/layer23/src/transceiver/main.c b/src/host/layer23/src/transceiver/main.c
index 1efa49c3..8c97f64b 100644
--- a/src/host/layer23/src/transceiver/main.c
+++ b/src/host/layer23/src/transceiver/main.c
@@ -51,6 +51,7 @@ static void print_help(char *argv[])
printf( "Some useful options:\n"
" -h --help this text\n"
" -d --debug MASK Enable debugging (e.g. -d DL1C:DTRX)\n"
+ " -e --log-level LOGL Set log level (1=debug, 3=info, 5=notice)\n"
" -D --daemonize For the process into a background daemon\n"
" -s --disable-color Don't use colors in stderr log output\n"
" -a --arfcn-sync ARFCN Set ARFCN to sync to\n"
@@ -65,13 +66,14 @@ static void handle_options(int argc, char **argv, struct app_state *as)
static const struct option long_options[] = {
{ "help", 0, 0, 'h' },
{ "debug", 1, 0, 'd' },
+ { "log-level", 1, 0, 'e' },
{ "daemonize", 0, 0, 'D' },
{ "disable-color", 0, 0, 's' },
{ "arfcn-sync", 1, 0, 'a' },
{ "arfcn-sync-pcs", 0, 0, 'p' },
};
- c = getopt_long(argc, argv, "hd:Dsa:p",
+ c = getopt_long(argc, argv, "hd:e:Dsa:p",
long_options, &option_idx);
if (c == -1)
@@ -98,6 +100,9 @@ static void handle_options(int argc, char **argv, struct app_state *as)
case 'p':
as->arfcn_sync |= ARFCN_PCS;
break;
+ case 'e':
+ log_set_log_level(as->stderr_target, atoi(optarg));
+ break;
default:
fprintf(stderr, "Unknow option %s\n", optarg);
exit(0);