Storing result of DCS data point processing in reference data
[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
19/**
20 * @class AliHLTTPCLog
21 * This class implements the old HLT TPC logging mechanism.
22 * Logging messages are now forwarded to the HLT logging system
23 * \em Note: the old LOG and ENDLOG macros should be used any longer,
24 * use the HLT logging macros or AliRoot logging macros instead.
25 * @see AliHLTLogging
26 */
27class AliHLTTPCLog {
a6c02c85 28 public:
29 enum TLogLevel { kNone = 0, kDebug= 0x01, kInformational = 0x02, kWarning = 0x04, kError = 0x08 , kFatal = 0x10, kPrimary = 0x80, kAll = 0x9F };
fc455fba 30
31 /** not used */
32 static const char* kEnd; //! transient
33 /** not used */
34 static const char* kPrec; //! transient
35 /** stream manipulator for hex output, but empty in the implementation */
36 static const char* kHex; //! transient
37 /** stream manipulator for decimal output, but empty in the implementation */
38 static const char* kDec; //! transient
39
40 /** the logging filter */
41 static TLogLevel fgLevel; // see above
42
43 /** key to indicate the origin part */
44 static const char* fgKeyOrigin; //! transient
45 /** key to indicate the keyword part */
46 static const char* fgKeyKeyword; //! transient
47 /** key to indicate the message part */
48 static const char* fgKeyMessage; //! transient
49
50 /** a stringstream to receive the output */
51 static stringstream fgStream; // see above
52 /** HLT logging instance */
53 static AliHLTLogging fgHLTLogging; // see above
54
55 /**
56 * Flush the stringstream and print output to the HLT logging system.
57 * The attributes are set before the message is streamed into the
58 * stringstream.<br>
59 * The LOG macro sets the attributes from the macro arguments and provides
60 * the stringstream.<br>
61 * The ENDLOG macro calls the Flush method after the message was streamed
62 * into the stringstream.
63 */
64 static const char* Flush();
e67b0680 65
66 private:
67 /** copy constructor prohibited */
68 AliHLTTPCLog(const AliHLTTPCLog&);
69 /** assignment operator prohibited */
70 AliHLTTPCLog& operator=(const AliHLTTPCLog&);
71
a6c02c85 72};
73
fc455fba 74/** LOG macro to be used by the TPC code
75 * \em Note: this macro should be used any longer
76 */
a6c02c85 77#define LOG( lvl, origin, keyword ) \
fc455fba 78 if (lvl>=AliHLTTPCLog::fgLevel) AliHLTTPCLog::fgStream << lvl \
79 << " " << AliHLTTPCLog::fgKeyOrigin << " " << origin \
80 << " " << AliHLTTPCLog::fgKeyKeyword << " " << keyword \
81 << " " << AliHLTTPCLog::fgKeyMessage << " "
82
83/** ENDLOG macro calls the Flush method
84 * \em Note: this macro should be used any longer
85 */
86#define ENDLOG AliHLTTPCLog::Flush()
87
a6c02c85 88#endif /* ALIHLTTPCLOG_H */