]>
Commit | Line | Data |
---|---|---|
645564ce | 1 | #ifndef ALIFMDDebug_H |
2 | #define ALIFMDDebug_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights | |
4 | * reserved. | |
5 | * | |
6 | * Latest changes by Christian Holm Christensen <cholm@nbi.dk> | |
7 | * | |
8 | * See cxx source for full Copyright notice | |
9 | */ | |
10 | /** @file AliFMD.h | |
11 | @author Christian Holm Christensen <cholm@nbi.dk> | |
12 | @date Sun Mar 26 17:59:37 2006 | |
13 | @brief Declaration of AliFMD detector driver | |
14 | */ | |
15 | //____________________________________________________________________ | |
16 | // | |
17 | // Some more clever declarations of Debug macros | |
18 | // | |
19 | #include <AliLog.h> // ALILOG_H | |
20 | #ifdef LOG_NO_DEBUG | |
21 | #define AliFMDDebug(N, A) | |
22 | #else | |
23 | /** @defn AliFMDDebug | |
24 | @param N Debug level - always evaluated | |
25 | @param A Argument (including paranthesis) to Form - the message to | |
26 | print. Note, that @a A should contain balanced paranthesis, like | |
27 | @verbatim | |
28 | AliFMDDebug(1, ("Failed to decode line %d of %s", line, filename)); | |
29 | @endverbatim | |
30 | The point is, if the current log level isn't high enough, as | |
31 | returned by the AliLog object, then we do not want to evalute the | |
32 | call to Form, since that is an expensive call. We should always | |
33 | put macros like this into a @c do ... @c while loop, since that | |
34 | makes sure that evaluations are local, and that we can safely put | |
35 | a @c ; after the macro call. Note, that @c do ... @c while loop | |
36 | and the call with extra paranthis, are an old tricks used by many | |
37 | C coders (see for example Bison, the Linux kernel, and the like). | |
38 | */ | |
39 | #define AliFMDDebug(N, A) \ | |
40 | do { \ | |
41 | if (!AliLog::IsDebugEnabled() || \ | |
42 | AliLog::GetDebugLevel(MODULENAME(), ClassName()) < N) break; \ | |
43 | AliLog::Debug(N, Form A, MODULENAME(), ClassName(), FUNCTIONNAME(), \ | |
44 | __FILE__, __LINE__); } while (false) | |
45 | #endif | |
46 | ||
47 | #endif | |
48 | // | |
49 | // EOF | |
50 | // |