]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTLogging.h
Removing the lib files
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTLogging.h
index 769fb07a58f778cf3c1a44e86cbf524b5b4c18a9..b09858aed616414dd6b12b8a33c3d1354f819537 100644 (file)
@@ -3,15 +3,15 @@
 
 #ifndef ALIHLTLOGGING_H
 #define ALIHLTLOGGING_H
-/* This file is property of and copyright by the ALICE HLT Project        * 
- * ALICE Experiment at CERN, All rights reserved.                         *
- * See cxx source for full Copyright notice                               */
+///* This file is property of and copyright by the                          * 
+///* ALICE Experiment at CERN, All rights reserved.                         *
+///* See cxx source for full Copyright notice                               */
 
-/** @file   AliHLTLogging.h
-    @author Matthias Richter, Timm Steinbeck
-    @date   
-    @brief  HLT module logging primitives.
-*/
+/// @file   AliHLTLogging.h
+/// @author Matthias Richter, Timm Steinbeck
+/// @date   
+/// @brief  HLT module logging primitives.
+///
 
 #include "AliHLTDataTypes.h"
 #include "AliHLTStdIncludes.h"
@@ -131,6 +131,8 @@ public:
 
   /**
    * Set a temporary keyword
+   * Keywords need to be static const strings, the class handles only
+   * pointers and assumes the strings to be persistent.
    * returns the old key value
    */
   const char* SetKeyword(const char* keyword) 
@@ -247,6 +249,11 @@ public:
    */
   static void SetLocalLoggingDefault(AliHLTComponentLogSeverity level);
 
+  /**
+   * Get default setting for local logging filter for individual objects.
+   */
+  static AliHLTComponentLogSeverity GetLocalLoggingDefault() { return fgLocalLogDefault; }
+
   /**
    * Get local logging level
    * logging filter for individual object
@@ -265,7 +272,7 @@ public:
    * @param bAppend    append to current content
    * @return const char string with the formatted message 
    */
-  static const char* BuildLogString(const char *format, va_list ap, bool bAppend=false);
+  static const char* BuildLogString(const char *format, va_list &ap, bool bAppend=false);
 
   /**
    * Set the log string from format specifier and from variable arguments.
@@ -344,13 +351,14 @@ private:
   /** groups of classes not to print debug messages */
   static TString fgWhiteList;                                      //! transient
   
-  ClassDef(AliHLTLogging, 3)
+  ClassDef(AliHLTLogging, 0)
 };
 
 /* the class AliHLTKeyword is a simple helper class used by the HLTLogKeyword macro
  * HLTLogKeyword("a keyword") creates an object of AliHLTKeyword which sets the keyword for the logging class
  * the object is destroyed automatically when the current scope is left and so the keyword is set
- * to the original value
+ * to the original value. Please note that all keywords need to be static strings, only pointyers
+ * are handled and the strings required to ber persistent.
  */
 class AliHLTKeyword {
  public:
@@ -361,30 +369,18 @@ class AliHLTKeyword {
     {
     }
 
-  AliHLTKeyword(AliHLTLogging* parent, const char* keyword)
+  AliHLTKeyword(const AliHLTLogging* parent, const char* keyword)
     :
-    fpParent(parent),
+    fpParent(const_cast<AliHLTLogging*>(parent)),
     fpOriginal(NULL)
     {
-      if (parent) {
+      // the const cast is on purpose in order to be allowed to use
+      // HLTLogKeyword from const member functions
+      if (fpParent) {
        fpOriginal=fpParent->SetKeyword(keyword);
       }
     }
 
-  AliHLTKeyword(const AliHLTKeyword& kw)
-    :
-    fpParent(kw.fpParent),
-    fpOriginal(kw.fpOriginal)
-    {
-    }
-
-  AliHLTKeyword& operator=(const AliHLTKeyword& kw)
-    { 
-      fpParent=kw.fpParent;
-      fpOriginal=kw.fpOriginal;
-      return *this;
-    }
-
   ~AliHLTKeyword()
     {
       if (fpParent) {
@@ -393,6 +389,11 @@ class AliHLTKeyword {
     }
 
  private:
+  /// copy constructor prohibited
+  AliHLTKeyword(const AliHLTKeyword& kw);
+  /// assignment operator prohibited
+  AliHLTKeyword& operator=(const AliHLTKeyword& kw);
+
   AliHLTLogging* fpParent;                                         //! transient
   const char* fpOriginal;                                          //! transient
 };