diff options
Diffstat (limited to 'src/host/layer23/src/misc/app_cell_log.c')
-rw-r--r-- | src/host/layer23/src/misc/app_cell_log.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/host/layer23/src/misc/app_cell_log.c b/src/host/layer23/src/misc/app_cell_log.c index a72588f7..e80a7b25 100644 --- a/src/host/layer23/src/misc/app_cell_log.c +++ b/src/host/layer23/src/misc/app_cell_log.c @@ -30,7 +30,12 @@ #include <osmocom/bb/common/logging.h> #include <osmocom/bb/misc/cell_log.h> +#include <osmocore/talloc.h> + extern struct log_target *stderr_target; +extern void *l23_ctx; + +char *logname = "/var/log/osmocom.log"; int _scan_work(struct osmocom_ms *ms) { @@ -77,9 +82,30 @@ static int l23_cfg_supported() return L23_OPT_TAP | L23_OPT_DBG; } +static int l23_cfg_print_help() +{ + printf("\nApplication specific\n"); + printf(" -l --logfile LOGFILE Logfile for the cell log.\n"); + return 0; +} + +static int l23_cfg_handle(int c, const char *optarg) +{ + switch (c) { + case 'l': + logname = talloc_strdup(l23_ctx, optarg); + break; + } + + return 0; +} + static struct l23_app_info info = { .copyright = "Copyright (C) 2010 Andreas Eversberg\n", + .getopt_string = "l:", .cfg_supported = l23_cfg_supported, + .cfg_handle_opt = l23_cfg_handle, + .cfg_print_help = l23_cfg_print_help, }; struct l23_app_info *l23_app_info() |