]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Forgot this one - sorry
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 May 2007 14:56:36 +0000 (14:56 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 May 2007 14:56:36 +0000 (14:56 +0000)
FMD/AliFMDDebug.h [new file with mode: 0644]

diff --git a/FMD/AliFMDDebug.h b/FMD/AliFMDDebug.h
new file mode 100644 (file)
index 0000000..2fa0de6
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef ALIFMDDebug_H
+#define ALIFMDDebug_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
+ *
+ * See cxx source for full Copyright notice                               
+ */
+/** @file    AliFMD.h
+    @author  Christian Holm Christensen <cholm@nbi.dk>
+    @date    Sun Mar 26 17:59:37 2006
+    @brief   Declaration of AliFMD detector driver 
+*/
+//____________________________________________________________________
+//
+// Some more clever declarations of Debug macros 
+//
+#include <AliLog.h>                        // ALILOG_H
+#ifdef LOG_NO_DEBUG
+#define AliFMDDebug(N, A) 
+#else 
+/** @defn AliFMDDebug 
+    @param N Debug level - always evaluated 
+    @param A Argument (including paranthesis) to Form - the message to
+    print.  Note, that @a A should contain balanced paranthesis, like 
+    @verbatim 
+      AliFMDDebug(1, ("Failed to decode line %d of %s", line, filename));
+    @endverbatim 
+    The point is, if the current log level isn't high enough, as
+    returned by the AliLog object, then we do not want to evalute the
+    call to Form, since that is an expensive call.  We should always
+    put macros like this into a @c do ... @c while loop, since that
+    makes sure that evaluations are local, and that we can safely put
+    a @c ; after the macro call.  Note, that @c do ... @c while loop
+    and the call with extra paranthis, are an old tricks used by many
+    C coders (see for example Bison, the Linux kernel, and the like). 
+*/
+#define AliFMDDebug(N, A) \
+  do { \
+    if (!AliLog::IsDebugEnabled() || \
+      AliLog::GetDebugLevel(MODULENAME(), ClassName()) < N)  break; \
+    AliLog::Debug(N, Form A, MODULENAME(), ClassName(), FUNCTIONNAME(), \
+                 __FILE__, __LINE__); } while (false)
+#endif
+
+#endif
+//
+// EOF
+//