2 // Original: AliHLTLog.h,v 1.2 2004/06/11 16:06:33 loizides Exp $
9 #include "AliHLTLogging.h"
15 * This class implements the old HLT TPC logging mechanism.
16 * Logging messages are now forwarded to the HLT logging system
17 * \em Note: the old LOG and ENDLOG macros should be used any longer,
18 * use the HLT logging macros or AliRoot logging macros instead.
23 enum TLogLevel { kNone = 0, kDebug= 0x01, kInformational = 0x02, kWarning = 0x04, kError = 0x08 , kFatal = 0x10, kPrimary = 0x80, kAll = 0x9F };
26 static const char* kEnd; //! transient
28 static const char* kPrec; //! transient
29 /** stream manipulator for hex output, but empty in the implementation */
30 static const char* kHex; //! transient
31 /** stream manipulator for decimal output, but empty in the implementation */
32 static const char* kDec; //! transient
34 /** the logging filter */
35 static TLogLevel fgLevel; // see above
37 /** key to indicate the origin part */
38 static const char* fgKeyOrigin; //! transient
39 /** key to indicate the keyword part */
40 static const char* fgKeyKeyword; //! transient
41 /** key to indicate the message part */
42 static const char* fgKeyMessage; //! transient
44 /** a stringstream to receive the output */
45 static stringstream fgStream; // see above
46 /** HLT logging instance */
47 static AliHLTLogging fgHLTLogging; // see above
50 * Flush the stringstream and print output to the HLT logging system.
51 * The attributes are set before the message is streamed into the
53 * The LOG macro sets the attributes from the macro arguments and provides
54 * the stringstream.<br>
55 * The ENDLOG macro calls the Flush method after the message was streamed
56 * into the stringstream.
58 static const char* Flush();
61 /** LOG macro to be used by the TPC code
62 * \em Note: this macro should be used any longer
64 #define LOG( lvl, origin, keyword ) \
65 if (lvl>=AliHLTTPCLog::fgLevel) AliHLTTPCLog::fgStream << lvl \
66 << " " << AliHLTTPCLog::fgKeyOrigin << " " << origin \
67 << " " << AliHLTTPCLog::fgKeyKeyword << " " << keyword \
68 << " " << AliHLTTPCLog::fgKeyMessage << " "
70 /** ENDLOG macro calls the Flush method
71 * \em Note: this macro should be used any longer
73 #define ENDLOG AliHLTTPCLog::Flush()
75 #endif /* ALIHLTTPCLOG_H */