Add a --debug flag for DEBUG builds

If you compile with:

  DEBUG=true rake build

then all the commands get a --debug flag as an option which will make
the server dump crazy amounts of data to stderr.
This commit is contained in:
Alex Young
2012-05-31 13:31:22 +01:00
parent 268bebd408
commit 623a398767
6 changed files with 85 additions and 35 deletions

View File

@@ -12,12 +12,9 @@ void* xrealloc(void* ptr, size_t size);
void* xmalloc(size_t size);
#ifndef DEBUG
# define debug(msg, ...)
#else
# include <sys/times.h>
# define debug(msg, ...) fprintf(stderr, "%08x %4d: " msg "\n" , \
(int) pthread_self(), (int) clock(), ##__VA_ARGS__)
void set_debug(int value);
#ifdef DEBUG
void debug(const char*msg, ...);
#endif
#define CLIENT_ERROR(msg, ...) \