3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
6 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
8 * See cxx source for full Copyright notice
11 @author Christian Holm Christensen <cholm@nbi.dk>
12 @date Sun Mar 26 17:59:37 2006
13 @brief Declaration of AliFMD detector driver
15 //____________________________________________________________________
17 // Some more clever declarations of Debug macros
19 #include <AliLog.h> // ALILOG_H
21 #define AliFMDDebug(N, A)
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
28 AliFMDDebug(1, ("Failed to decode line %d of %s", line, filename));
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).
39 #define AliFMDDebug(N, A) \
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)