Created parser and interfaces for creating specific parsers for specific
[qshowdiff.git] / src / debug.h
blob56146dfa045dd5fcf1bed4c1952a0c95e2dfea83
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 DB(msg, type)
36 #define ERROR(msg, type)
37 #define WARNING(msg, type)
38 #endif
40 #endif