diff options
author | Rob Bradford <rob@o-hand.com> | 2008-08-26 14:34:28 +0100 |
---|---|---|
committer | Rob Bradford <rob@o-hand.com> | 2008-09-01 11:41:21 +0100 |
commit | a461d2d7af6482fafcf992433b5d35dac23e51e5 (patch) | |
tree | 0dd27dd208fbe623f567f2b8ad936fca91539e1c /rest/rest-private.h | |
parent | 278d8d407f569cd2a1c3f88544389301da695c11 (diff) | |
download | librest-a461d2d7af6482fafcf992433b5d35dac23e51e5.tar.gz |
Add a debugging macro that can output debugging conditional on an env. var.
Diffstat (limited to 'rest/rest-private.h')
-rw-r--r-- | rest/rest-private.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/rest/rest-private.h b/rest/rest-private.h new file mode 100644 index 0000000..3b6e5f0 --- /dev/null +++ b/rest/rest-private.h @@ -0,0 +1,25 @@ +#ifndef _REST_PRIVATE +#define _REST_PRIVATE + +#include <glib.h> + +G_BEGIN_DECLS + +typedef enum +{ + REST_DEBUG_XML_PARSER = 1 << 0, + REST_DEBUG_PROXY = 1 << 1, + REST_DEBUG_ALL = REST_DEBUG_XML_PARSER | REST_DEBUG_PROXY +} RestDebugFlags; + +extern guint rest_debug_flags; + +#define REST_DEBUG(category,x,a...) G_STMT_START { \ + if (rest_debug_flags & REST_DEBUG_##category) \ + { g_message ("[" #category "] " G_STRLOC ": " x, ##a); } \ + } G_STMT_END + +void _rest_setup_debugging (void); + +G_END_DECLS +#endif /* _REST_PRIVATE */ |