ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataUtil/interface/Debug.h
Revision: 1.5
Committed: Tue Jun 24 14:05:03 2008 UTC (16 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.4: +2 -5 lines
Log Message:
Cosmetics.

File Contents

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