diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-05-30 21:23:44 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-05-30 21:23:44 +0100 |
commit | 6d183c02a50a42743c3031532f458ab5cea0685d (patch) | |
tree | d1463e8f53df26ec5f8c3c13a77880d11d3bc57f /functions.h | |
parent | ef93f4d61f03faa0edd60f11c7790ad3b67b44d4 (diff) |
Convert debugprint() from being to file/screen/disabled to always being to file with configurable verbosity.
Diffstat (limited to 'functions.h')
-rw-r--r-- | functions.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/functions.h b/functions.h index d56a295..dc3c4c3 100644 --- a/functions.h +++ b/functions.h @@ -21,12 +21,15 @@ #define OK 0 #define NO_INPUT 1 #define TOO_LONG 2 -#define DEBUG_NONE 0 -#define DEBUG_FILE 1 -#define DEBUG_SCREEN 2 -// Print debugging output if enabled -void debugprint(char *format, ...); +#define DEBUG_CRIT 0 +#define DEBUG_SOME 1 +#define DEBUG_FULL 2 + +// Write debug string to file. +// Debug level is provided by level, set to one of DEBUG_CRIT, DEBUG_SOME or DEBUG_FULL. +// Debug is only written if the global int "debug" is greater than or equal to the level. +void debugprint(int level, char *format, ...); // Get stdin line with buffer overrun protection int getstdin(char *prompt, char *buff, size_t sz); |