]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/AliHLTTPCLog.h
Record changes.
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCLog.h
CommitLineData
a6c02c85 1// @(#) $Id$
4aa41877 2// Original: AliHLTLog.h,v 1.2 2004/06/11 16:06:33 loizides Exp $
a6c02c85 3
4#ifndef ALIHLTTPCLOG_H
5#define ALIHLTTPCLOG_H
6
fc455fba 7#include <sstream>
8#include <iostream>
9#include "AliHLTLogging.h"
db16520a 10
fc455fba 11using namespace std;
12
13/**
14 * @class AliHLTTPCLog
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.
19 * @see AliHLTLogging
20 */
21class AliHLTTPCLog {
a6c02c85 22 public:
23 enum TLogLevel { kNone = 0, kDebug= 0x01, kInformational = 0x02, kWarning = 0x04, kError = 0x08 , kFatal = 0x10, kPrimary = 0x80, kAll = 0x9F };
fc455fba 24
25 /** not used */
26 static const char* kEnd; //! transient
27 /** not used */
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
33
34 /** the logging filter */
35 static TLogLevel fgLevel; // see above
36
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
43
44 /** a stringstream to receive the output */
45 static stringstream fgStream; // see above
46 /** HLT logging instance */
47 static AliHLTLogging fgHLTLogging; // see above
48
49 /**
50 * Flush the stringstream and print output to the HLT logging system.
51 * The attributes are set before the message is streamed into the
52 * stringstream.<br>
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.
57 */
58 static const char* Flush();
a6c02c85 59};
60
fc455fba 61/** LOG macro to be used by the TPC code
62 * \em Note: this macro should be used any longer
63 */
a6c02c85 64#define LOG( lvl, origin, keyword ) \
fc455fba 65 if (lvl>=AliHLTTPCLog::fgLevel) AliHLTTPCLog::fgStream << lvl \
66 << " " << AliHLTTPCLog::fgKeyOrigin << " " << origin \
67 << " " << AliHLTTPCLog::fgKeyKeyword << " " << keyword \
68 << " " << AliHLTTPCLog::fgKeyMessage << " "
69
70/** ENDLOG macro calls the Flush method
71 * \em Note: this macro should be used any longer
72 */
73#define ENDLOG AliHLTTPCLog::Flush()
74
a6c02c85 75#endif /* ALIHLTTPCLOG_H */