]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/AliHLTTPCLog.h
Typo corrected.
[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
e67b0680 7// see below for class documentation
8// or
9// refer to README to build package
10// or
11// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
12
fc455fba 13#include <sstream>
14#include <iostream>
15#include "AliHLTLogging.h"
db16520a 16
fc455fba 17using namespace std;
18
0df7eea7 19/** key to indicate the origin part */
20#define AliHLTTPCLogKeyOrigin "__origin"
21/** key to indicate the keyword part */
22#define AliHLTTPCLogKeyKeyword "__key"
23/** key to indicate the message part */
24#define AliHLTTPCLogKeyMessage "__message"
25
fc455fba 26/**
27 * @class AliHLTTPCLog
28 * This class implements the old HLT TPC logging mechanism.
29 * Logging messages are now forwarded to the HLT logging system
30 * \em Note: the old LOG and ENDLOG macros should be used any longer,
31 * use the HLT logging macros or AliRoot logging macros instead.
32 * @see AliHLTLogging
33 */
34class AliHLTTPCLog {
a6c02c85 35 public:
055fed30 36 enum TLogLevel { kNone = 0, kBenchmark=0x01,kDebug= 0x02, kInformational = 0x04, kWarning = 0x08, kError = 0x10 , kFatal = 0x20, kPrimary = 0x80, kAll = 0xBF };
fc455fba 37
6a8e0bb4 38 private:
fc455fba 39 /** not used */
40 static const char* kEnd; //! transient
41 /** not used */
42 static const char* kPrec; //! transient
6a8e0bb4 43 public:
fc455fba 44 /** stream manipulator for hex output, but empty in the implementation */
45 static const char* kHex; //! transient
46 /** stream manipulator for decimal output, but empty in the implementation */
47 static const char* kDec; //! transient
48
fc455fba 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();
e67b0680 59
0df7eea7 60 /**
61 * Get the stream.
62 */
63 static stringstream& GetStream() {return fgStream;}
64
65 /**
66 * Get the logging level.
67 */
68 static TLogLevel GetLevel() {return fgLevel;}
69
e67b0680 70 private:
0df7eea7 71 /** a stringstream to receive the output */
72 static stringstream fgStream; // see above
73
74 /** the logging filter */
75 static TLogLevel fgLevel; // see above
76
77 /** HLT logging instance */
78 static AliHLTLogging fgHLTLogging; // see above
79
e67b0680 80 /** copy constructor prohibited */
81 AliHLTTPCLog(const AliHLTTPCLog&);
82 /** assignment operator prohibited */
83 AliHLTTPCLog& operator=(const AliHLTTPCLog&);
84
a6c02c85 85};
86
fc455fba 87/** LOG macro to be used by the TPC code
88 * \em Note: this macro should be used any longer
89 */
a6c02c85 90#define LOG( lvl, origin, keyword ) \
0df7eea7 91 if (lvl>=AliHLTTPCLog::GetLevel()) AliHLTTPCLog::GetStream() << lvl \
92 << " " << AliHLTTPCLogKeyOrigin << " " << origin \
93 << " " << AliHLTTPCLogKeyKeyword << " " << keyword \
94 << " " << AliHLTTPCLogKeyMessage << " "
fc455fba 95
96/** ENDLOG macro calls the Flush method
97 * \em Note: this macro should be used any longer
98 */
99#define ENDLOG AliHLTTPCLog::Flush()
100
a6c02c85 101#endif /* ALIHLTTPCLOG_H */