Prettified error messages, first work on Util::Config server helpers.
This commit is contained in:
parent
c6f63dfb95
commit
5c0f053006
25 changed files with 1254 additions and 327 deletions
18
lib/defines.h
Normal file
18
lib/defines.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Defines to print debug messages.
|
||||
#define DLVL_NONE 0 // All debugging disabled.
|
||||
#define DLVL_FAIL 1 // Only messages about failed operations.
|
||||
#define DLVL_ERROR 2 // Only messages about errors and failed operations.
|
||||
#define DLVL_WARN 3 // Warnings, errors, and fail messages.
|
||||
#define DLVL_DEVEL 4 // All of the above, plus status messages handy during development.
|
||||
#define DLVL_MEDIUM 5 // Slightly more than just development-level messages.
|
||||
#define DLVL_HIGH 6 // Verbose debugging messages.
|
||||
#define DLVL_VERYHIGH 7 // Very verbose debugging messages.
|
||||
#define DLVL_EXTREME 8 // Everything is reported in extreme detail.
|
||||
#define DLVL_INSANE 9 // Everything is reported in insane detail.
|
||||
#define DLVL_DONTEVEN 10 // All messages enabled, even pointless ones.
|
||||
#if DEBUG > 0
|
||||
#include <stdio.h>
|
||||
#define DEBUG_MSG(lvl, msg, ...) if (DEBUG >= lvl){fprintf(stderr, "[%s:%d] " msg "\n", __FILE__, __LINE__, ##__VA_ARGS__);}
|
||||
#else
|
||||
#define DEBUG_MSG(lvl, msg, ...) // Debugging disabled.
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue