]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTLogging.cxx
ALIROOT-5420 Missing include
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTLogging.cxx
index 1f23458de9d160282108fee970029c43a3e8915f..52ce3f0e2f5ce8f393a63799784cabec495cb575 100644 (file)
@@ -1,30 +1,26 @@
-// @(#) $Id$
-
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project        * 
- * ALICE Experiment at CERN, All rights reserved.                         *
- *                                                                        *
- * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
- *                  for The ALICE HLT Project.                            *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/** @file   AliHLTLogging.cxx
-    @author Matthias Richter, Timm Steinbeck
-    @date   
-    @brief  Implementation of HLT logging primitives.
-*/
-
-#if __GNUC__>= 3
-using namespace std;
-#endif
+// $Id$
+
+///**************************************************************************
+///* This file is property of and copyright by the                          * 
+///* ALICE Experiment at CERN, All rights reserved.                         *
+///*                                                                        *
+///* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
+///*                  for The ALICE HLT Project.                            *
+///*                                                                        *
+///* Permission to use, copy, modify and distribute this software and its   *
+///* documentation strictly for non-commercial purposes is hereby granted   *
+///* without fee, provided that the above copyright notice appears in all   *
+///* copies and that both the copyright notice and this permission notice   *
+///* appear in the supporting documentation. The authors make no claims     *
+///* about the suitability of this software for any purpose. It is          *
+///* provided "as is" without express or implied warranty.                  *
+///**************************************************************************
+
+/// @file   AliHLTLogging.cxx
+/// @author Matthias Richter, Timm Steinbeck
+/// @date   
+/// @brief  Implementation of HLT logging primitives.
+///
 
 #include "AliHLTStdIncludes.h"
 #include "AliHLTLogging.h"
@@ -35,6 +31,10 @@ using namespace std;
 #include <sstream>
 #include <iostream>
 
+using std::cout;
+using std::cerr;
+using std::endl;
+
 /** ROOT macro for the implementation of ROOT specific class methods */
 ClassImp(AliHLTLogging);
 
@@ -151,7 +151,7 @@ int AliHLTLogging::InitAliLogFunc(AliHLTComponentHandler* pHandler)
     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");
+             "symbol lookup failure: can not find AliDynamicMessage, switching to HLT logging system");
       iResult=-ENOSYS;
     }
   } else {
@@ -241,7 +241,7 @@ int AliHLTLogging::AliMessage(AliHLTComponentLogSeverity severity,
 }
 #endif
 
-const char* AliHLTLogging::BuildLogString(const char *format, va_list ap, bool bAppend) 
+const char* AliHLTLogging::BuildLogString(const char *format, va_list &ap, bool bAppend) 
 {
   // see header file for class documentation
 
@@ -302,13 +302,20 @@ const char* AliHLTLogging::BuildLogString(const char *format, va_list ap, bool b
   return fgAliHLTLoggingTarget.GetArray();
 }
 
-const char* AliHLTLogging::SetLogString(const char *format, ...)
+const char* AliHLTLogging::SetLogString(const void* p, const char* pfmt, const char *format, ...)
 {
   // see header file for class documentation
+  if (!p || !pfmt) return NULL;
+  TString formatstr=format;
+  TString pstr;
+#ifdef __DEBUG
+  pstr.Form(pfmt, p);
+#endif
+  formatstr.ReplaceAll("_pfmt_", pstr);
   va_list args;
   va_start(args, format);
 
-  const char* message=BuildLogString(format, args);
+  const char* message=BuildLogString(formatstr.Data(), args);
   va_end(args);
 
   return message;