ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataUtil/interface/Debug.h
Revision: 1.6
Committed: Mon Jul 7 16:41:52 2008 UTC (16 years, 10 months ago) by paus
Content type: text/plain
Branch: MAIN
Changes since 1.5: +8 -10 lines
Log Message:
Implement simple Ascii file driven catalog. Easily extensible, though.

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: Debug.h,v 1.5 2008/06/24 14:05:03 loizides Exp $
3 //
4 // Debug - detailed logging / debug scheme
5 //
6 // This class defines the debuging masks (EDebugMask), which are used with the MDB (MIT DeBug) macro
7 // together with the log levels to control the verbosity. As a rule of thumb:
8 //
9 // level 1 and 2 should not be used in (event) loops, level 3 and 4 might be used in loops.
10 //
11 // Please, do not introduce more levels!
12 //
13 // Authors: C.Loizides
14 //--------------------------------------------------------------------------------------------------
15
16 #ifndef DATAUTIL_DEBUG_H
17 #define DATAUTIL_DEBUG_H
18
19 #include <Rtypes.h>
20 #include <TError.h>
21
22 namespace mithep
23 {
24 class Debug
25 {
26 public:
27 enum EDebugMask {
28 kNone = 0,
29 kGeneral = 1,
30 kTreeIO = 2,
31 kAnalysis = 4,
32 kModules = 8,
33 kAll = 0xFFFFFFFF
34 };
35 private:
36 Debug();
37 virtual ~Debug() {}
38 Debug(const Debug &cpy);
39
40 ClassDef(Debug, 0) // Defines different debug masks
41 };
42 }
43
44 R__EXTERN mithep::Debug::EDebugMask gDebugMask;
45 R__EXTERN Int_t gDebugLevel;
46
47 #define MDB(mask,level) \
48 if ((mithep::Debug::mask & gDebugMask) && gDebugLevel >= (level))
49
50 #define MitAssert(f,e) \
51 if (!(e)) Fatal(f, kAssertMsg, _QUOTE_(e), __LINE__, __FILE__)
52
53 #define MitAssertStatic(f,e) \
54 if (!(e)) ::Fatal(f, kAssertMsg, _QUOTE_(e), __LINE__, __FILE__)
55
56 #endif