DEBUG_MSG edits.

This commit is contained in:
Thulinma 2014-06-02 15:08:17 +02:00
parent 064c4ecdcc
commit ee0c27c688

View file

@ -13,12 +13,22 @@
#define DLVL_INSANE 9 // Everything is reported in insane detail.
#define DLVL_DONTEVEN 10 // All messages enabled, even pointless ones.
#if DEBUG > -1
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include "config.h"
extern char * program_invocation_short_name;
static const char* DBG_LVL_LIST[] = {"NONE","FAIL","ERROR","WARN","DEVEL","MEDIUM","HIGH","VERYHIGH","EXTREME","INSANE","DONTEVEN"};
#define DEBUG_MSG(lvl, msg, ...) if (Util::Config::printDebugLevel >= lvl){fprintf(stderr, "%s [%d][%s:%d] " msg "\n", DBG_LVL_LIST[lvl],getpid(), __FILE__, __LINE__, ##__VA_ARGS__);}
#define DEBUG_MSG(lvl, msg, ...) if (Util::Config::printDebugLevel >= lvl){fprintf(stderr, "%s|%s|%d|%s:%d|" msg "\n", DBG_LVL_LIST[lvl], program_invocation_short_name, getpid(), __FILE__, __LINE__, ##__VA_ARGS__);}
#else
#define DEBUG_MSG(lvl, msg, ...) // Debugging disabled.
#endif
#endif
//include errno.h
//program_invocation_short_name