LCOV - code coverage report
Current view: top level - HLT/TPCLib - AliHLTTPCLog.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 2 33 6.1 %
Date: 2016-06-14 17:26:59 Functions: 2 3 66.7 %

          Line data    Source code
       1             : // $Id$
       2             : // Original: AliHLTLog.cxx,v 1.1 2004/05/14 09:37:22 loizides 
       3             : 
       4             : // lagacy logging methods for HLT TPC code
       5             : // or                                                                        //
       6             : // refer to README to build package                                          //
       7             : // or                                                                        //
       8             : // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt                          //
       9             : 
      10             : #include "AliHLTTPCLog.h"
      11             : 
      12             : AliHLTTPCLog::TLogLevel AliHLTTPCLog::fgLevel=AliHLTTPCLog::kNone;
      13             : 
      14             : const char* AliHLTTPCLog::kEnd = "";
      15             : const char* AliHLTTPCLog::kPrec = "";
      16             : const char* AliHLTTPCLog::kHex = "";
      17             : const char* AliHLTTPCLog::kDec = "";
      18             : 
      19           6 : stringstream AliHLTTPCLog::fgStream;
      20             : 
      21           6 : AliHLTLogging AliHLTTPCLog::fgHLTLogging;
      22             : 
      23             : const char* AliHLTTPCLog::Flush()
      24             : {
      25             :   // see header file for class documentation
      26           0 :   int severity=0;
      27           0 :   string origin("");
      28           0 :   string keyword("");
      29           0 :   string iter;
      30           0 :   string message("");
      31             :   int scanStatus=0;
      32           0 :   fgStream >> severity;
      33           0 :   while (!fgStream.eof()) {
      34           0 :     fgStream >> iter;
      35           0 :     if (scanStatus==0 && iter.compare(AliHLTTPCLogKeyOrigin)==0) {
      36             :       // idicate scan of origin message
      37             :       scanStatus=1;
      38           0 :       continue;
      39           0 :     } else if (scanStatus==1 && iter.compare(AliHLTTPCLogKeyKeyword)==0) {
      40             :       // idicate scan of keyword message
      41             :       scanStatus=2;
      42           0 :       continue;
      43           0 :     } else if (scanStatus==2 && iter.compare(AliHLTTPCLogKeyMessage)==0) {
      44             :       scanStatus=3;
      45           0 :       continue;
      46             :     }
      47           0 :     switch (scanStatus) {
      48             :     case 1:
      49           0 :       if (!origin.empty()) origin+=" ";
      50           0 :       origin+=iter;
      51             :       break;
      52             :     case 2:
      53           0 :       if (!keyword.empty()) keyword+=" ";
      54           0 :       keyword+=iter;
      55             :       break;
      56             :     default:
      57             :       // if we have come here already for the first word, we don't
      58             :       // expect origin and keyword any more
      59             :       scanStatus=3;
      60           0 :       if (!message.empty()) message+=" ";
      61           0 :       message+=iter;
      62             :     }
      63             :   }
      64             :   
      65             :   // flush the string stream and send out through the logging system
      66           0 :   switch (severity) {
      67             :   case kDebug:
      68           0 :     fgHLTLogging.Logging(kHLTLogDebug, origin.c_str(), keyword.c_str(), message.c_str());
      69             :     break;
      70             :   case kInformational:
      71           0 :     fgHLTLogging.Logging(kHLTLogInfo, origin.c_str(), keyword.c_str(), message.c_str());
      72             :     break;
      73             :   case kWarning:
      74           0 :     fgHLTLogging.Logging(kHLTLogWarning, origin.c_str(), keyword.c_str(), message.c_str());
      75             :     break;
      76             :   case kError:
      77           0 :     fgHLTLogging.Logging(kHLTLogError, origin.c_str(), keyword.c_str(), message.c_str());
      78             :     break;
      79             :   case kFatal:
      80             :   case kPrimary:
      81           0 :     fgHLTLogging.Logging(kHLTLogFatal, origin.c_str(), keyword.c_str(), message.c_str());
      82             :     break;
      83             :   }
      84           0 :   fgStream.clear();
      85           0 :   string empty("");
      86           0 :   fgStream.str(empty);
      87             :   return "";
      88           0 : }
      89             : 

Generated by: LCOV version 1.11