From e229ff613379e6ae555dc0282237deaaa9d2206e Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Fri, 30 Aug 2013 23:38:15 +1000 Subject: common: Fix setting of debug level in the client code Signed-off-by: Amitay Isaacs (This used to be ctdb commit 299fa487549e36572b757852d21471f9e23f6e8f) --- ctdb/common/cmdline.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ctdb/common/cmdline.c b/ctdb/common/cmdline.c index 59e8722196c..cd59d84757b 100644 --- a/ctdb/common/cmdline.c +++ b/ctdb/common/cmdline.c @@ -144,6 +144,13 @@ struct ctdb_context *ctdb_cmdline_client(struct tevent_context *ev, } } + /* Set the debug level */ + if (isalpha(ctdb_cmdline.debuglevel[0]) || ctdb_cmdline.debuglevel[0] == '-') { + LogLevel = get_debug_by_desc(ctdb_cmdline.debuglevel); + } else { + LogLevel = strtol(ctdb_cmdline.debuglevel, NULL, 0); + } + ret = ctdb_socket_connect(ctdb); if (ret != 0) { fprintf(stderr, __location__ " Failed to connect to daemon\n"); -- cgit v1.2.1