Improved Makefiles.
[qshowdiff.git] / src / debug.h
blob0a669977b9fd705c2a5f3e59ef5943ffbfeaecd6
1 /**
2 * In this file are placed all macros and stuff for debuging,
3 */
4 #ifndef _DEBUG_H_
5 #define _DEBUG_H_
7 /**
8 * header files
9 */
10 #ifndef NDEBUG
11 #include <iostream>
12 #endif
14 /**
15 * TODO: Colored output
16 * DBG("error" << "message");
17 * ERROR("error" << "message");
19 #ifndef NDEBUG
21 #define DEBUG_HELPER(msg, type) \
22 std::cerr << __FILE__ << ": " << __LINE__ << ": " << type << ": " \
23 << msg << std::endl; \
24 std::cerr.flush()
26 #define DEBUG_HELPER(msg, type) \
27 std::cerr << msg << std::endl; \
28 std::cerr.flush()
29 #define DBG(msg) DEBUG_HELPER(msg, "Debug")
30 #define ERROR(msg) DEBUG_HELPER(msg, "Error")
31 #define WARNING(msg) DEBUG_HELPER(msg, "Warning")
32 #define MILESTONE(msg) DEBUG_HELPER(msg, "Milestone")
33 #else
34 #define DEBUG_HELPER(msg, type)
35 #define DBG(msg)
36 #define ERROR(msg, type)
37 #define WARNING(msg, type)
38 #define MILESTONE(msg)
39 #endif
41 #endif