summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormethodus <methodus@web.de>2012-12-30 14:13:25 +0100
committermethodus <methodus@web.de>2012-12-30 14:13:25 +0100
commitc55ace1b1cc9a9b27e3da5ca55bb7c93b41142cd (patch)
tree8f69f2ad5733de5e0be17a9cec21bc5ce6bb555c /include
parenta758404f2a9c7f1b05b437cf776d691156ce1d09 (diff)
downloadvdr-plugin-upnp-c55ace1b1cc9a9b27e3da5ca55bb7c93b41142cd.tar.gz
vdr-plugin-upnp-c55ace1b1cc9a9b27e3da5ca55bb7c93b41142cd.tar.bz2
Added debug flag for more detailed debugging information. Removed some output from regular logging
Diffstat (limited to 'include')
-rw-r--r--include/tools.h17
1 files changed, 17 insertions, 0 deletions
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__ "<unknown>"
+ #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<std::string> StringList;