From c55ace1b1cc9a9b27e3da5ca55bb7c93b41142cd Mon Sep 17 00:00:00 2001 From: methodus Date: Sun, 30 Dec 2012 14:13:25 +0100 Subject: Added debug flag for more detailed debugging information. Removed some output from regular logging --- include/tools.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') diff --git a/include/tools.h b/include/tools.h index 966040d..e640da5 100644 --- a/include/tools.h +++ b/include/tools.h @@ -32,6 +32,23 @@ using namespace std; #define _unused(x) ((void)x) +#ifdef DEBUG + +#if __STDC_VERSION__ < 199901L + #if __GNUC__ >= 2 + #define __func__ __PRETTY_FUNCTION__ + #else + #define __func__ "" + #endif +#endif + +#define LOG(level, msg...) upnp::log_debug_msg(__FILE__, __func__, __LINE__, level, msg); + +namespace upnp { + void log_debug_msg(const char* file, const char* func, int line, int level, const char* msg, ...) __attribute__ ((format (printf, 5, 6))); +} +#endif + namespace upnp { typedef std::list StringList; -- cgit v1.2.3