]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
coding conventions
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Oct 2007 08:56:16 +0000 (08:56 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Oct 2007 08:56:16 +0000 (08:56 +0000)
HLT/TPCLib/AliHLTTPCLog.cxx
HLT/TPCLib/AliHLTTPCLog.h

index bb725e6de451ddf69aa02bed484222e66c7ca90a..150a8841552ae0c0dbde2718b8f7fe767ef509a0 100644 (file)
@@ -16,10 +16,6 @@ const char* AliHLTTPCLog::kPrec = "";
 const char* AliHLTTPCLog::kHex = "";
 const char* AliHLTTPCLog::kDec = "";
 
-const char* AliHLTTPCLog::fgKeyOrigin ="__origin";
-const char* AliHLTTPCLog::fgKeyKeyword="__key";
-const char* AliHLTTPCLog::fgKeyMessage="__message";
-
 stringstream AliHLTTPCLog::fgStream;
 
 AliHLTLogging AliHLTTPCLog::fgHLTLogging;
@@ -36,15 +32,15 @@ const char* AliHLTTPCLog::Flush()
   fgStream >> severity;
   while (!fgStream.eof()) {
     fgStream >> iter;
-    if (scanStatus==0 && iter.compare(fgKeyOrigin)==0) {
+    if (scanStatus==0 && iter.compare(AliHLTTPCLogKeyOrigin)==0) {
       // idicate scan of origin message
       scanStatus=1;
       continue;
-    } else if (scanStatus==1 && iter.compare(fgKeyKeyword)==0) {
+    } else if (scanStatus==1 && iter.compare(AliHLTTPCLogKeyKeyword)==0) {
       // idicate scan of keyword message
       scanStatus=2;
       continue;
-    } else if (scanStatus==2 && iter.compare(fgKeyMessage)==0) {
+    } else if (scanStatus==2 && iter.compare(AliHLTTPCLogKeyMessage)==0) {
       scanStatus=3;
       continue;
     }
index e29e6c3b59ea085bd79a09aadb55defbbead30ff..e9aa393a255f35c612227cf43f900d716abd8383 100644 (file)
 
 using namespace std;
 
+/** key to indicate the origin part */
+#define AliHLTTPCLogKeyOrigin  "__origin"
+/** key to indicate the keyword part */
+#define AliHLTTPCLogKeyKeyword "__key" 
+/** key to indicate the message part */
+#define AliHLTTPCLogKeyMessage "__message"
+
 /**
  * @class AliHLTTPCLog
  * This class implements the old HLT TPC logging mechanism.
@@ -37,21 +44,6 @@ class AliHLTTPCLog  {
   /** stream manipulator for decimal output, but empty in the implementation */
   static const char* kDec;                                         //! transient
 
-  /** the logging filter */
-  static TLogLevel fgLevel;                                        // see above
-
-  /** key to indicate the origin part */
-  static const char* fgKeyOrigin;                                  //! transient
-  /** key to indicate the keyword part */
-  static const char* fgKeyKeyword;                                 //! transient
-  /** key to indicate the message part */
-  static const char* fgKeyMessage;                                 //! transient
-
-  /** a stringstream to receive the output */
-  static stringstream fgStream;                                    // see above
-  /** HLT logging instance */
-  static AliHLTLogging fgHLTLogging;                               // see above
-
   /**
    * Flush the stringstream and print output to the HLT logging system.
    * The attributes are set before the message is streamed into the
@@ -63,7 +55,26 @@ class AliHLTTPCLog  {
    */
   static const char* Flush();
 
+  /**
+   * Get the stream.
+   */
+  static stringstream& GetStream() {return fgStream;}
+
+  /**
+   * Get the logging level.
+   */
+  static TLogLevel GetLevel() {return fgLevel;}
+
  private:
+  /** a stringstream to receive the output */
+  static stringstream fgStream;                                    // see above
+
+  /** the logging filter */
+  static TLogLevel fgLevel;                                        // see above
+
+  /** HLT logging instance */
+  static AliHLTLogging fgHLTLogging;                               // see above
+
   /** copy constructor prohibited */
   AliHLTTPCLog(const AliHLTTPCLog&);
   /** assignment operator prohibited */
@@ -75,10 +86,10 @@ class AliHLTTPCLog  {
  * \em Note: this macro should be used any longer 
  */
 #define LOG( lvl, origin, keyword ) \
if (lvl>=AliHLTTPCLog::fgLevel) AliHLTTPCLog::fgStream << lvl \
-                           << " " << AliHLTTPCLog::fgKeyOrigin  << " " << origin \
-                           << " " << AliHLTTPCLog::fgKeyKeyword << " " << keyword \
-                          << " " << AliHLTTPCLog::fgKeyMessage << " "
 if (lvl>=AliHLTTPCLog::GetLevel()) AliHLTTPCLog::GetStream() << lvl  \
+                           << " " << AliHLTTPCLogKeyOrigin  << " " << origin \
+                           << " " << AliHLTTPCLogKeyKeyword << " " << keyword \
+                          << " " << AliHLTTPCLogKeyMessage << " "
 
 /** ENDLOG macro calls the Flush method 
  * \em Note: this macro should be used any longer