common: Fix setting of debug level in the client code
authorAmitay Isaacs <amitay@gmail.com>
Fri, 30 Aug 2013 13:38:15 +0000 (23:38 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Fri, 4 Oct 2013 05:15:35 +0000 (15:15 +1000)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
common/cmdline.c

index 59e8722196ce22f76bcaeb85de5133c0c8917349..cd59d84757bb237086b3c33bd858f114c3008d2c 100644 (file)
@@ -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");