]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Using variadic free HLT logging macros in order to drop AliRoot dependencies of HLTbase
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 12 Aug 2009 21:24:46 +0000 (21:24 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 12 Aug 2009 21:24:46 +0000 (21:24 +0000)
HLT/BASE/AliHLTHOMERBlockDesc.cxx
HLT/BASE/AliHLTHOMERBlockDesc.h
HLT/BASE/AliHLTHOMERManager.cxx
HLT/BASE/AliHLTHOMERManager.h
HLT/BASE/AliHLTHOMERProxyHandler.cxx
HLT/BASE/AliHLTHOMERProxyHandler.h

index fe13e64011748f1ee56a4c724759f8068259cb35..c11ad887d210073fbe8bdf6fb22a08ac4e783770 100644 (file)
@@ -33,8 +33,6 @@
 
 #include "AliHLTMessage.h"
 
-#include "AliLog.h"
-
 #include "TMath.h"
 #include "TClass.h"
 
index 5222d0ad2222031b6dfdb220d07335eee8f155b2..151db394fbeb7675861e022d172528eb7abb9d24 100644 (file)
@@ -23,7 +23,7 @@ class AliHLTMessage;
 #include "TString.h"
 #include "TObject.h"
 
-//#include "AliHLTLogging.h"
+#include "AliHLTLoggingVariadicFree.h"
 
 /**
  * @class AliHLTHOMERBlockDesc
@@ -35,7 +35,7 @@ class AliHLTMessage;
  * 
  * @ingroup alihlt_homer
  */
-class AliHLTHOMERBlockDesc : public TObject/*, public AliHLTLogging*/ {
+class AliHLTHOMERBlockDesc : public TObject, public AliHLTLogging {
 
 public:
 
index d5ae1968df44693f9538a94813222e6c86a3f6ce..a9e2c5a31799ef12a1c870d1cbecb0cd5837b999 100644 (file)
@@ -40,7 +40,6 @@
 #include "AliHLTHOMERSourceDesc.h"
 #include "AliHLTHOMERBlockDesc.h"
 // -- -- -- -- -- -- -- 
-#include "AliLog.h"
 ClassImp(AliHLTHOMERManager)
 
 /*
@@ -106,11 +105,11 @@ Int_t AliHLTHOMERManager::Initialize() {
   if ( fProxyHandler ) {
     iResult = fProxyHandler->Initialize();
     if (iResult)
-      AliError(Form("Initialize of ProxyHandler failed."));
+      HLTError(Form("Initialize of ProxyHandler failed."));
   }
   else {
     iResult = -1;
-    AliError(Form("Creating of ProxyHandler failed."));
+    HLTError(Form("Creating of ProxyHandler failed."));
   }
  
   return iResult;
@@ -137,13 +136,13 @@ Int_t AliHLTHOMERManager::CreateSourcesList() {
 
   iResult = fProxyHandler->FillSourceList( fSourceList );
   if ( iResult < 0 ) {
-    AliWarning(Form("There have been errors, while creating the sources list."));
+    HLTWarning(Form("There have been errors, while creating the sources list."));
   }
   else if ( iResult > 0 ) {
-    AliWarning(Form("No active services found."));
+    HLTWarning(Form("No active services found."));
   }
   else {
-     AliInfo(Form("New sources list created."));
+     HLTInfo(Form("New sources list created."));
 
     // -- New SourceList has been created 
     // --> All Sources are new --> State has changed
@@ -179,7 +178,7 @@ Int_t AliHLTHOMERManager::ConnectHOMER( TString detector ){
 
   // -- Check if already connected and state has not changed
   if ( fStateHasChanged == kFALSE && IsConnected() ) {
-    AliInfo(Form("No need for reconnection."));
+    HLTInfo(Form("No need for reconnection."));
     return iResult;
   }
 
@@ -194,7 +193,7 @@ Int_t AliHLTHOMERManager::ConnectHOMER( TString detector ){
 
   CreateReadoutList( sourceHostnames, sourcePorts, sourceCount, detector );
   if ( sourceCount == 0 ) {
-    AliError(Form("No sources selected, aborting."));
+    HLTError(Form("No sources selected, aborting."));
     return -1;
   }
 
@@ -202,7 +201,7 @@ Int_t AliHLTHOMERManager::ConnectHOMER( TString detector ){
   if ( !fReader && fLibManager )
     fReader = fLibManager->OpenReader( sourceCount, sourceHostnames, sourcePorts );
   else {
-    AliError(Form("No LibManager present."));
+    HLTError(Form("No LibManager present."));
     return -2;
   }
     
@@ -213,11 +212,11 @@ Int_t AliHLTHOMERManager::ConnectHOMER( TString detector ){
     UInt_t ndx = fReader->GetErrorConnectionNdx();
 
     if ( ndx < sourceCount ) {
-      AliError(Form("Error establishing connection to TCP source %s:%hu: %s (%d)",
+      HLTError(Form("Error establishing connection to TCP source %s:%hu: %s (%d)",
                    sourceHostnames[ndx], sourcePorts[ndx], strerror(iResult), iResult));
     }
     else {
-      AliError(Form("Error establishing connection to unknown source with index %d: %s (%d)",
+      HLTError(Form("Error establishing connection to unknown source with index %d: %s (%d)",
                    ndx, strerror(iResult), iResult));
     }
 
@@ -229,7 +228,7 @@ Int_t AliHLTHOMERManager::ConnectHOMER( TString detector ){
     // -- Connection ok - set reader
     fConnected = kTRUE;
 
-    AliInfo(Form("Connection established."));
+    HLTInfo(Form("Connection established."));
   }
 
   delete[] sourceHostnames;
@@ -252,7 +251,7 @@ void AliHLTHOMERManager::DisconnectHOMER(){
   fStateHasChanged = kTRUE;
   fConnected = kFALSE;
 
-  AliInfo(Form("Connection closed."));
+  HLTInfo(Form("Connection closed."));
 
   return;
 }
@@ -268,7 +267,7 @@ Int_t AliHLTHOMERManager::ReconnectHOMER( TString detector="" ){
 
   iResult = ConnectHOMER(detector);
   if ( iResult ) {
-    AliError(Form("Error reconnecting."));
+    HLTError(Form("Error reconnecting."));
   }
 
   return iResult;
@@ -289,7 +288,7 @@ Int_t AliHLTHOMERManager::NextEvent(){
   Int_t iRetryCount = 0;
 
   if ( !fReader || ! IsConnected() ) {
-    AliWarning(Form( "Not connected yet." ));
+    HLTWarning(Form( "Not connected yet." ));
     return -1;
   }
 
@@ -301,12 +300,12 @@ Int_t AliHLTHOMERManager::NextEvent(){
     iResult = fReader->ReadNextEvent( 40000000 /*timeout in us*/);
 
     if ( iResult == 111 || iResult == 32 || iResult == 6 ) {
-      AliError(Form("No Connection to source %d: %s (%d)", 
+      HLTError(Form("No Connection to source %d: %s (%d)", 
                    fReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
       return -iResult;
     }
     else if ( iResult == 110 ) {
-      AliError(Form("Timout occured, reading event from source %d: %s (%d)", 
+      HLTError(Form("Timout occured, reading event from source %d: %s (%d)", 
                    fReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
       return -iResult;
     }
@@ -314,18 +313,18 @@ Int_t AliHLTHOMERManager::NextEvent(){
       ++iRetryCount;
 
       if ( iRetryCount >= 20 ) {
-       AliError(Form("Retry Failed: Error reading event from source %d: %s (%d)", 
+       HLTError(Form("Retry Failed: Error reading event from source %d: %s (%d)", 
                      fReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
        return -iResult;
       }
       else {
-       AliError(Form("Retry: Error reading event from source %d: %s (%d)", 
+       HLTError(Form("Retry: Error reading event from source %d: %s (%d)", 
                      fReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
        continue;
       }
     }
     else if ( iResult ) {
-      AliError(Form("General Error reading event from source %d: %s (%d)", 
+      HLTError(Form("General Error reading event from source %d: %s (%d)", 
                    fReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
       fConnected = kFALSE;
       return -iResult;
@@ -340,7 +339,7 @@ Int_t AliHLTHOMERManager::NextEvent(){
   fEventID = static_cast<ULong64_t>(fReader->GetEventID());
   fCurrentBlk = 0;
 
-  AliInfo(Form("Event 0x%016LX (%Lu) with %lu blocks", fEventID, fEventID, fNBlks));
+  HLTInfo(Form("Event 0x%016LX (%Lu) with %lu blocks", fEventID, fEventID, fNBlks));
 
 #if EVE_DEBUG
   // Loop for Debug only
@@ -354,18 +353,18 @@ Int_t AliHLTHOMERManager::NextEvent(){
     void *tmp21 = tmp2;
     ULong_t* tmp22 = static_cast<ULong_t*>(tmp21);
     *tmp22 = fReader->GetBlockDataOrigin(ii);
-    AliInfo(Form( "Block %lu length: %lu - type: %s - origin: %s - spec 0x%08X",
+    HLTInfo(Form( "Block %lu length: %lu - type: %s - origin: %s - spec 0x%08X",
                  ii, fReader->GetBlockDataLength(ii), tmp1, tmp2, fReader->GetBlockDataSpec(ii) ));
   } // end for ( ULong_t ii = 0; ii < fNBlks; ii++ ) {
 #endif
 
   // -- Create BlockList
   if ( fNBlks > 0 ) {
-    AliInfo(Form("Create Block List"));
+    HLTInfo(Form("Create Block List"));
     CreateBlockList();
   }
   else {
-    AliWarning(Form("Event 0x%016LX (%Lu) with %lu blocks", fEventID, fEventID, fNBlks));
+    HLTWarning(Form("Event 0x%016LX (%Lu) with %lu blocks", fEventID, fEventID, fNBlks));
   }
     
   return iResult;
@@ -482,7 +481,7 @@ void* AliHLTHOMERManager::GetBlk( Int_t ndx ) {
   // Get pointer to current block in current event
    
   if ( !fReader || !IsConnected() ) {
-    AliError(Form("Not connected yet."));
+    HLTError(Form("Not connected yet."));
     return NULL;
   }
   if ( ndx < static_cast<Int_t>(fNBlks) )
@@ -496,7 +495,7 @@ ULong_t AliHLTHOMERManager::GetBlkSize( Int_t ndx ) {
   // see header file for class documentation
    
   if ( !fReader || !IsConnected() ) {
-    AliError(Form("Not connected yet."));
+    HLTError(Form("Not connected yet."));
     return 0;
   }
   
@@ -514,13 +513,13 @@ TString AliHLTHOMERManager::GetBlkOrigin( Int_t ndx ) {
 
   // -- Check for Connection
   if ( !fReader || ! IsConnected() ) {
-    AliError(Form("Not connected yet."));
+    HLTError(Form("Not connected yet."));
     return origin;
   }
 
   // -- Check block index
   if ( ndx >= static_cast<Int_t>(fNBlks) ) {
-    AliError(Form("Block index %d out of range.", ndx ));
+    HLTError(Form("Block index %d out of range.", ndx ));
     return origin;
   }
 
@@ -550,13 +549,13 @@ TString AliHLTHOMERManager::GetBlkType( Int_t ndx ) {
 
   // -- Check for Connection
   if ( !fReader || ! IsConnected() ) {
-    AliError(Form("Not connected yet."));
+    HLTError(Form("Not connected yet."));
     return type;
   }
 
   // -- Check block index
   if ( ndx >= static_cast<Int_t>(fNBlks) ) {
-    AliError(Form("Block index %d out of range.", ndx ));
+    HLTError(Form("Block index %d out of range.", ndx ));
     return type;
   }
 
@@ -584,13 +583,13 @@ ULong_t AliHLTHOMERManager::GetBlkSpecification( Int_t ndx ) {
 
   // -- Check for Connection
   if ( !fReader || ! IsConnected() ) {
-    AliError(Form("Not connected yet."));
+    HLTError(Form("Not connected yet."));
     return 0;
   }
 
   // -- Check block index
   if ( ndx >= static_cast<Int_t>(fNBlks) ) {
-    AliError(Form("Block index %d out of range.", ndx ));
+    HLTError(Form("Block index %d out of range.", ndx ));
     return 0;
   }
 
@@ -615,7 +614,7 @@ Bool_t AliHLTHOMERManager::CheckIfRequested( AliHLTHOMERBlockDesc * block ) {
     if ( ! source->IsSelected() )
       continue;
     else
-      AliError(Form("IS SELECTED"));
+      HLTError(Form("IS SELECTED"));
     
     // -- Check if detector matches
     if ( source->GetSourceName().CompareTo( block->GetBlockName() ) )
@@ -628,10 +627,10 @@ Bool_t AliHLTHOMERManager::CheckIfRequested( AliHLTHOMERBlockDesc * block ) {
   
 #if EVE_DEBUG
   if ( requested ) {
-    AliInfo(Form("Block requested : %s", block->GetBlockName().Data())); 
+    HLTInfo(Form("Block requested : %s", block->GetBlockName().Data())); 
   }
   else {
-    AliInfo(Form("Block NOT requested : %s", block->GetBlockName().Data())); 
+    HLTInfo(Form("Block NOT requested : %s", block->GetBlockName().Data())); 
   }
 #endif
 
index 59841a1f3ef1cc0208c74bdb55e5d10135f0f068..c67992d047f340c534c302e73848b968b33cf5bd 100644 (file)
@@ -25,7 +25,7 @@
 #include "AliHLTHOMERReader.h"
 #include "AliHLTHOMERProxyHandler.h"
 
-//#include "AliHLTLogging.h"
+#include "AliHLTLoggingVariadicFree.h"
 
 class AliHLTHOMERLibManager;
 
@@ -44,7 +44,7 @@ class AliHLTHOMERLibManager;
  * @ingroup alihlt_homer
  */
 
-class AliHLTHOMERManager : public TObject//, public AliHLTLogging 
+class AliHLTHOMERManager : public TObject, public AliHLTLogging 
 {
 public:
   
index f5643415b91c56afa1c8a0638ec8565344d1b280..ba98e469e3157e313e3a27fd66fc5fde09148d2c 100644 (file)
@@ -38,7 +38,6 @@
 // -- -- -- -- -- -- -- 
 #include "AliHLTHOMERProxyHandler.h"
 // -- -- -- -- -- -- -- 
-#include "AliLog.h"
 
 ClassImp(AliHLTHOMERProxyHandler)
 
@@ -97,7 +96,7 @@ Int_t AliHLTHOMERProxyHandler::FillSourceList(TList *srcList) {
     iResult = ProcessXmlRpcResponse();
 
   if (iResult < 0) {
-    AliError(Form("Filling SourceList failed."));
+    HLTError(Form("Filling SourceList failed."));
   }
 
   return iResult;
@@ -158,12 +157,12 @@ Int_t AliHLTHOMERProxyHandler::RequestXmlRpcResponse() {
 
   TSocket *socket = new TSocket(fgkHOMERProxyNode[fRealm], proxyPort);
   if ( ! socket->IsValid() ) {
-    AliWarning(Form("Failed to create socket to %s:%d,",fgkHOMERProxyNode[fRealm], proxyPort));
-    AliWarning(Form("trying %s:%d now.", fgkHOMERProxyNode[fRealm+kHOMERRealmsMax],proxyPort));
+    HLTWarning(Form("Failed to create socket to %s:%d,",fgkHOMERProxyNode[fRealm], proxyPort));
+    HLTWarning(Form("trying %s:%d now.", fgkHOMERProxyNode[fRealm+kHOMERRealmsMax],proxyPort));
 
     socket = new TSocket(fgkHOMERProxyNode[fRealm+kHOMERRealmsMax], proxyPort);
     if ( ! socket->IsValid() ) {
-      AliError(Form("Failed to create socket to %s:%d and %s:%d.",
+      HLTError(Form("Failed to create socket to %s:%d and %s:%d.",
                    fgkHOMERProxyNode[fRealm], proxyPort,
                    fgkHOMERProxyNode[fRealm+kHOMERRealmsMax],proxyPort));
 
@@ -188,7 +187,7 @@ Content-Length: 68\r\n\
   iResult = socket->SendRaw( reqMsg, strlen(reqMsg) );
   if ( iResult < 1 || 
        iResult !=  static_cast<Int_t>(strlen(reqMsg))) {
-    AliError(Form("Error sending! -- send length %d  -- msg length %d.", iResult, static_cast<Int_t>(strlen(reqMsg)) ));
+    HLTError(Form("Error sending! -- send length %d  -- msg length %d.", iResult, static_cast<Int_t>(strlen(reqMsg)) ));
     socket->Close();
     return iResult;
   }
@@ -213,7 +212,7 @@ Content-Length: 68\r\n\
 
       iResult = socket->RecvRaw(&buffer[bufferLength], 1);
       if ( iResult < 0) {
-       AliError(Form("Error reading form socket."));
+       HLTError(Form("Error reading form socket."));
        socket->Close();
        return iResult;
       }
@@ -261,11 +260,11 @@ Int_t AliHLTHOMERProxyHandler::ProcessXmlRpcResponse() {
   TDOMParser xmlParser;
   xmlParser.SetValidate(kFALSE);
 
-  AliInfo(Form("XMLResponse: %s",fXmlRpcResponse.Data()));
+  HLTInfo(Form("XMLResponse: %s",fXmlRpcResponse.Data()));
 
   iResult = xmlParser.ParseBuffer(fXmlRpcResponse.Data(), fXmlRpcResponse.Length());
   if ( iResult < 0 ) {
-    AliError(Form("Parsing buffer with error: %s", 
+    HLTError(Form("Parsing buffer with error: %s", 
                  xmlParser.GetParseCodeMessage(xmlParser.GetParseCode()) ));
     
 
@@ -276,7 +275,7 @@ Int_t AliHLTHOMERProxyHandler::ProcessXmlRpcResponse() {
     GetChildren()->GetChildren()->GetChildren()->GetChildren();
   
   if ( strcmp( node->GetNodeName(), "string" ) ) {
-    AliError(Form("No node 'string' in XmlRpcResponse."));
+    HLTError(Form("No node 'string' in XmlRpcResponse."));
     return -1;
   }
 
@@ -286,11 +285,11 @@ Int_t AliHLTHOMERProxyHandler::ProcessXmlRpcResponse() {
   // -- Get Content
   TString xmlContent(node->GetText() );
 
-  AliInfo(Form("XMLContent: %s",xmlContent.Data()));
+  HLTInfo(Form("XMLContent: %s",xmlContent.Data()));
 
   iResult = xmlParser.ParseBuffer(xmlContent.Data(), xmlContent.Length());
   if ( iResult < 0 ) {
-    AliError(Form("Parsing buffer with error: %s", 
+    HLTError(Form("Parsing buffer with error: %s", 
                  xmlParser.GetParseCodeMessage(xmlParser.GetParseCode()) ));
 
     return iResult;
@@ -298,7 +297,7 @@ Int_t AliHLTHOMERProxyHandler::ProcessXmlRpcResponse() {
   
 
   if ( !xmlParser.GetXMLDocument()->GetRootNode()->HasChildren() ) {
-    AliWarning(Form("No Services active."));
+    HLTWarning(Form("No Services active."));
     return 1;
   }
 
@@ -312,7 +311,7 @@ Int_t AliHLTHOMERProxyHandler::ProcessXmlRpcResponse() {
     // -- Add service to list
     iResult = AddService( serviceNode->GetChildren() );
     if ( iResult > 0 ) {
-      AliWarning(Form("Incomplete Service not added."));
+      HLTWarning(Form("Incomplete Service not added."));
       iResult = 0;
     }
   } while ( ( serviceNode = prevServiceNode->GetNextNode() ) && !iResult );
@@ -334,7 +333,7 @@ Int_t AliHLTHOMERProxyHandler::AddService(TXMLNode *innerNode) {
 
   Int_t iResult = 0;
 
-  AliInfo(Form(">> New service"));    
+  HLTInfo(Form(">> New service"));    
 
   // -- Loop over all service properties and 
   //    read them from the service tag
@@ -354,7 +353,7 @@ Int_t AliHLTHOMERProxyHandler::AddService(TXMLNode *innerNode) {
     if ( ! strcmp(innerNode->GetNodeName(), "text" ) )
       continue;
     
-    AliInfo(Form(" %s ++ %s", innerNode->GetNodeName(), innerNode->GetText() ));
+    HLTInfo(Form(" %s ++ %s", innerNode->GetNodeName(), innerNode->GetText() ));
     
     // -- hostname
     if ( ! strcmp( innerNode->GetNodeName(), "address") )
@@ -364,7 +363,7 @@ Int_t AliHLTHOMERProxyHandler::AddService(TXMLNode *innerNode) {
       if ( portS.IsDigit() )
        port = portS.Atoi();
       else {
-       AliError(Form("Port %s is not a digit.", portS.Data()));
+       HLTError(Form("Port %s is not a digit.", portS.Data()));
        iResult = -1;
       }
     }
@@ -387,7 +386,7 @@ Int_t AliHLTHOMERProxyHandler::AddService(TXMLNode *innerNode) {
   // -- Check for completeness of the source properties
   if ( hostname.IsNull() || !port || dataOrigin.IsNull() ||
        dataType.IsNull() || dataSpecification.IsNull() ) {
-    AliWarning(Form("Service provides not all values:\n\thostname\t\t %s\n\tport\t\t\t %d\n\tdataorigin\t\t %s\n\tdatatype\t\t %s\n\tdataspecification\t %s", 
+    HLTWarning(Form("Service provides not all values:\n\thostname\t\t %s\n\tport\t\t\t %d\n\tdataorigin\t\t %s\n\tdatatype\t\t %s\n\tdataspecification\t %s", 
                  hostname.Data(), port, dataOrigin.Data(), dataType.Data(), dataSpecification.Data()));
 
     return 1;
@@ -401,7 +400,7 @@ Int_t AliHLTHOMERProxyHandler::AddService(TXMLNode *innerNode) {
 
   fSourceList->Add( source );
 
-  AliInfo(Form( "New Source added : %s", source->GetSourceName().Data()));
+  HLTInfo(Form( "New Source added : %s", source->GetSourceName().Data()));
   
   return iResult;
 }
index c0dbf821d442780b29a39024f9d77283dfd6d011..7e97a8707fcc162cb50ca80286d1f47961e7fb97 100644 (file)
@@ -22,7 +22,7 @@
 // -- -- -- -- -- -- -- 
 #include "AliHLTHOMERSourceDesc.h"
 // -- -- -- -- -- -- -- 
-//#include "AliHLTLogging.h"
+#include "AliHLTLoggingVariadicFree.h"
 
 /**
  * @class AliHLTHOMERProxyHandler
@@ -32,7 +32,7 @@
  * @ingroup alihlt_homer
  */
 
-class AliHLTHOMERProxyHandler : public TObject//, public AliHLTLogging
+class AliHLTHOMERProxyHandler : public TObject, public AliHLTLogging
 {
 public: