From e3d5c581d4db00ea339bcf6a92c9f33c08351294 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 22 Mar 2021 18:13:09 +0100 Subject: [PATCH] text --- client/src/cmddata.c | 20 +++++++++++++++++--- client/src/ui.c | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/client/src/cmddata.c b/client/src/cmddata.c index 97026e644..7b6cb2b7b 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -395,9 +395,9 @@ static int CmdSetDebugMode(const char *Cmd) { }; CLIExecWithReturn(ctx, Cmd, argtable, true); - bool dg_0 = arg_get_lit(ctx, 0); - bool dg_1 = arg_get_lit(ctx, 1); - bool dg_2 = arg_get_lit(ctx, 2); + bool dg_0 = arg_get_lit(ctx, 1); + bool dg_1 = arg_get_lit(ctx, 2); + bool dg_2 = arg_get_lit(ctx, 3); CLIParserFree(ctx); if (dg_0 + dg_1 + dg_2 > 1 ) { @@ -412,6 +412,20 @@ static int CmdSetDebugMode(const char *Cmd) { if (dg_2) g_debugMode = 2; + + switch(g_debugMode) { + case 0: + PrintAndLogEx(INFO, "client debug level... %u ( no debug messages )", g_debugMode); + break; + case 1: + PrintAndLogEx(INFO, "client debug level... %u ( debug messages )", g_debugMode); + break; + case 2: + PrintAndLogEx(INFO, "client debug level... %u ( verbose debug messages )", g_debugMode); + break; + default: + break; + } return PM3_SUCCESS; } diff --git a/client/src/ui.c b/client/src/ui.c index 3c4069f5b..a044d7312 100644 --- a/client/src/ui.c +++ b/client/src/ui.c @@ -182,7 +182,7 @@ static uint8_t PrintAndLogEx_spinidx = 0; void PrintAndLogEx(logLevel_t level, const char *fmt, ...) { - // skip debug messages if client debugging is turned off i.e. 'DATA SETDEBUG 0' + // skip debug messages if client debugging is turned off i.e. 'DATA SETDEBUG -0' if (g_debugMode == 0 && level == DEBUG) return;