From 3ec111676ff9e34058b3bf2e482a236f341c10eb Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 15 Mar 2013 11:07:12 +0100 Subject: Add run-time changing of gsmd log level via libgsm/libgsmd-tool --- src/util/libgsmd-tool.c | 2 ++ src/util/shell.c | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'src/util') diff --git a/src/util/libgsmd-tool.c b/src/util/libgsmd-tool.c index 653139b..5fb1eca 100644 --- a/src/util/libgsmd-tool.c +++ b/src/util/libgsmd-tool.c @@ -1,6 +1,7 @@ /* libgsmd tool * * (C) 2006-2007 by OpenMoko, Inc. + * (C) 2013 by Harald Welte * Written by Harald Welte * All Rights Reserved * @@ -102,6 +103,7 @@ int main(int argc, char **argv) int mode = MODE_NONE, shellwait = 0; printf("libgsm-tool - (C) 2006-2007 by Harald Welte and OpenMoko, Inc.\n" + " (C) 2012-2013 by Harald Welte\n" "This program is Free Software and has ABSOLUTELY NO WARRANTY\n\n"); while (1) { diff --git a/src/util/shell.c b/src/util/shell.c index 6b461be..f1333dc 100644 --- a/src/util/shell.c +++ b/src/util/shell.c @@ -604,6 +604,7 @@ static void shell_help(void) "\tCFQ\tQuery the status of call forwarding (CFQ=reason)\n" "\tCFR\tRegister call forwarding (CFR=reason,number)\n" "\tCFe\tErase a record of call forwarding (CFe=reason)\n" + "\tlog=N\tSet gsmd Log Level (1=debug, 8=fatal)\n" "\tq\tQuit\n" ); } @@ -1024,6 +1025,10 @@ int shell_main(struct lgsm_handle *lgsmh, int sync) printf("Battery Connection status and Battery Charge Level\n"); lgsm_get_battery(lgsmh); pending_responses++; + } else if (!strncmp(buf, "log=", 4)) { + int gsmd_loglevel = atoi(buf+4); + lgsm_set_gsmd_loglevel(lgsmh, gsmd_loglevel); + pending_responses++; }else { printf("Unknown command `%s'\n", buf); } -- cgit v1.2.3