]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/AliHLTTPCLog.cxx
documentation; deprecated defines deleted
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCLog.cxx
CommitLineData
a6c02c85 1// $Id$
4aa41877 2// Original: AliHLTLog.cxx,v 1.1 2004/05/14 09:37:22 loizides
a6c02c85 3
fc455fba 4#include "AliHLTTPCLog.h"
a6c02c85 5
6AliHLTTPCLog::TLogLevel AliHLTTPCLog::fgLevel=AliHLTTPCLog::kNone;
7
db16520a 8const char* AliHLTTPCLog::kEnd = "";
9const char* AliHLTTPCLog::kPrec = "";
10const char* AliHLTTPCLog::kHex = "";
11const char* AliHLTTPCLog::kDec = "";
db16520a 12
fc455fba 13const char* AliHLTTPCLog::fgKeyOrigin ="__origin";
14const char* AliHLTTPCLog::fgKeyKeyword="__key";
15const char* AliHLTTPCLog::fgKeyMessage="__message";
16
17stringstream AliHLTTPCLog::fgStream;
18
19AliHLTLogging AliHLTTPCLog::fgHLTLogging;
20
21const char* AliHLTTPCLog::Flush()
22{
23 int severity=0;
24 string origin("");
25 string keyword("");
26 string iter;
27 string message("");
28 int scanStatus=0;
29 fgStream >> severity;
30 while (!fgStream.eof()) {
31 fgStream >> iter;
32 if (scanStatus==0 && iter.compare(fgKeyOrigin)==0) {
33 // idicate scan of origin message
34 scanStatus=1;
35 continue;
36 } else if (scanStatus==1 && iter.compare(fgKeyKeyword)==0) {
37 // idicate scan of keyword message
38 scanStatus=2;
39 continue;
40 } else if (scanStatus==2 && iter.compare(fgKeyMessage)==0) {
41 scanStatus=3;
42 continue;
43 }
44 switch (scanStatus) {
45 case 1:
46 if (!origin.empty()) origin+=" ";
47 origin+=iter;
48 break;
49 case 2:
50 if (!keyword.empty()) keyword+=" ";
51 keyword+=iter;
52 break;
53 default:
54 // if we have come here already for the first word, we don't
55 // expect origin and keyword any more
56 scanStatus=3;
57 if (!message.empty()) message+=" ";
58 message+=iter;
59 }
60 }
61
62 // flush the string stream and send out through the logging system
63 switch (severity) {
64 case kDebug:
65 fgHLTLogging.Logging(kHLTLogDebug, origin.c_str(), keyword.c_str(), message.c_str());
66 break;
67 case kInformational:
68 fgHLTLogging.Logging(kHLTLogInfo, origin.c_str(), keyword.c_str(), message.c_str());
69 break;
70 case kWarning:
71 fgHLTLogging.Logging(kHLTLogWarning, origin.c_str(), keyword.c_str(), message.c_str());
72 break;
73 case kError:
74 fgHLTLogging.Logging(kHLTLogError, origin.c_str(), keyword.c_str(), message.c_str());
75 break;
76 case kFatal:
77 case kPrimary:
78 fgHLTLogging.Logging(kHLTLogFatal, origin.c_str(), keyword.c_str(), message.c_str());
79 break;
80 }
81 fgStream.clear();
82 string empty("");
83 fgStream.str(empty);
84 return "";
85}
db16520a 86