-// @(#) $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"
#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);
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 {
}
#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
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;