comparison base/Debug.h @ 1247:8f076d02569a piper

Make SVDEBUG always write to a log file -- formerly this was disabled in NDEBUG builds. I think there's little use to that, it just means that we keep adding more cerr debug output because we aren't getting the log we need. And SVDEBUG logging is not usually used in tight loops, I don't think the performance overhead is too serious. Also update the About box.
author Chris Cannam
date Thu, 03 Nov 2016 14:57:00 +0000
parents c1e43c8d2527
children ad2d3e0a8b7c
comparison
equal deleted inserted replaced
1246:75aefcc9f07d 1247:8f076d02569a
34 34
35 using std::cout; 35 using std::cout;
36 using std::cerr; 36 using std::cerr;
37 using std::endl; 37 using std::endl;
38 38
39 #ifndef NDEBUG
40
41 class SVDebug { 39 class SVDebug {
42 public: 40 public:
43 SVDebug(); 41 SVDebug();
44 ~SVDebug(); 42 ~SVDebug();
45 43
70 68
71 extern SVDebug &getSVDebug(); 69 extern SVDebug &getSVDebug();
72 70
73 #define SVDEBUG getSVDebug() 71 #define SVDEBUG getSVDebug()
74 72
75 #else
76
77 class NoDebug
78 {
79 public:
80 inline NoDebug() {}
81 inline ~NoDebug(){}
82
83 template <typename T>
84 inline NoDebug &operator<<(const T &) { return *this; }
85
86 inline NoDebug &operator<<(QTextStreamFunction) { return *this; }
87 };
88
89 #define SVDEBUG NoDebug()
90
91 #endif /* !NDEBUG */
92
93 #endif /* !_DEBUG_H_ */ 73 #endif /* !_DEBUG_H_ */
94 74