]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTLogging.cxx
starting proper implementation of control evente (SOR,EOR, etc.) into AliHLTSystem...
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTLogging.cxx
index 91de4fb45fd69ec8abeba702f457a92de243f41e..564f1ad7f48d29a33b3f2c1028b17d623c2b3755 100644 (file)
@@ -102,13 +102,22 @@ int AliHLTLogging::Init(AliHLTfctLogging pFun)
 int AliHLTLogging::InitAliLogTrap(AliHLTComponentHandler* pHandler)
 {
   // see header file for class documentation
+  // init the AliRoot logging trap
+  // AliLog messages are redirected to PubSub,
   int iResult=0;
   if (pHandler) {
+    // set temporary loglevel of component handler
     AliHLTComponentLogSeverity loglevel=pHandler->GetLocalLoggingLevel();
     pHandler->SetLocalLoggingLevel(kHLTLogError);
-    pHandler->LoadLibrary("libAliHLTUtil.so");
+
+    // load library containing AliRoot dependencies and initialization handler
+    pHandler->LoadLibrary(ALILOG_WRAPPER_LIBRARY, 0/* do not activate agents */);
+
+    // restore loglevel
     pHandler->SetLocalLoggingLevel(loglevel);
-    InitAliDynamicMessageCallback pFunc=(InitAliDynamicMessageCallback)pHandler->FindSymbol("libAliHLTUtil.so", "InitAliDynamicMessageCallback"); 
+
+    // find the symbol
+    InitAliDynamicMessageCallback pFunc=(InitAliDynamicMessageCallback)pHandler->FindSymbol(ALILOG_WRAPPER_LIBRARY, "InitAliDynamicMessageCallback"); 
     if (pFunc) {
       iResult=(*pFunc)();
     } else {
@@ -123,6 +132,35 @@ int AliHLTLogging::InitAliLogTrap(AliHLTComponentHandler* pHandler)
   return iResult;
 }
 
+int AliHLTLogging::InitAliLogFunc(AliHLTComponentHandler* pHandler)
+{
+  // see header file for class documentation
+  int iResult=0;
+  if (pHandler) {
+    // set temporary loglevel of component handler
+    AliHLTComponentLogSeverity loglevel=pHandler->GetLocalLoggingLevel();
+    pHandler->SetLocalLoggingLevel(kHLTLogError);
+
+    // load library containing AliRoot dependencies and initialization handler
+    pHandler->LoadLibrary(ALILOG_WRAPPER_LIBRARY, 0/* do not activate agents */);
+
+    // restore loglevel
+    pHandler->SetLocalLoggingLevel(loglevel);
+
+    // find the symbol
+    fgAliLoggingFunc=(AliHLTLogging::AliHLTDynamicMessage)pHandler->FindSymbol(ALILOG_WRAPPER_LIBRARY, "AliDynamicMessage");
+    if (fgAliLoggingFunc==NULL) {
+      Message(NULL, kHLTLogError, "AliHLTLogging::InitAliLogFunc", "init logging",
+             "symbol lookp failure: can not find AliDynamicMessage, switching to HLT logging system");
+      iResult=-ENOSYS;
+    }
+  } else {
+    iResult=-EINVAL;
+  }
+  
+  return iResult;
+}
+
 int AliHLTLogging::Message(void *param, AliHLTComponentLogSeverity severity,
                           const char* origin, const char* keyword,
                           const char* message) 
@@ -153,6 +191,9 @@ int AliHLTLogging::Message(void *param, AliHLTComponentLogSeverity severity,
   case kHLTLogFatal:
     strSeverity="fatal";
     break;
+  case kHLTLogImportant:
+    strSeverity="notify";
+    break;
   default:
     break;
   }
@@ -348,7 +389,7 @@ AliHLTComponentLogSeverity AliHLTLogging::GetLocalLoggingLevel()
   return fLocalLogFilter;
 }
 
-int AliHLTLogging::CheckGroup(const char* originClass) const
+int AliHLTLogging::CheckGroup(const char* /*originClass*/) const
 {
   // see header file for class documentation