chg: skip printing DEBUG messages if global client debug variable it set to zero.

This commit is contained in:
iceman1001 2018-02-21 14:42:00 +01:00
parent 8b61916525
commit 69aa3bfeed

View file

@ -27,8 +27,13 @@ void PrintAndLogEx(logLevel_t level, char *fmt, ...) {
int size; int size;
static char *prefix[7] = { "", "[+] ", "[=] ", "[-] ", "[!] ", "[!!] ", "[#] "}; static char *prefix[7] = { "", "[+] ", "[=] ", "[-] ", "[!] ", "[!!] ", "[#] "};
size=strlen(prefix[level]); if (g_debugMode == 0 && level == logLevel.DEBUG) {
strncpy(buffer, prefix[level], sizeof buffer); // skip debug messages if client debugging is turned off i.e. 'DATA SETDEBUG 0'
}
else {
size = strlen(prefix[level]);
strncpy(buffer, prefix[level], sizeof buffer);
}
va_list args; va_list args;
va_start(args,fmt); va_start(args,fmt);