From 22a5325b08fb738ba74e27970ab8eabe3fb408de Mon Sep 17 00:00:00 2001 From: richterm Date: Wed, 3 Mar 2010 14:33:46 +0000 Subject: [PATCH] restoring backward compatibility for the AliLog trap after recent changes in AliLog (r38921) --- HLT/configure.ac | 13 ++++++++++--- HLT/rec/AliHLTDynamicAliLog.cxx | 4 ++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/HLT/configure.ac b/HLT/configure.ac index c0882a4b482..24844780eb5 100644 --- a/HLT/configure.ac +++ b/HLT/configure.ac @@ -234,15 +234,22 @@ if test ! "x$have_aliroot" = "xno" ; then dnl dnl check whether AliLog supports notification callback + dnl 2010-03-03: revision 38921 introduces AliLog::GetRootLogger in order to make AliLog + dnl a pure sigleton, introduce a 2-level check here dnl LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS" have_alilog_notification=no if test ! "x$have_aliroot" = "xno" ; then AC_MSG_CHECKING([whether AliLog supports notification callback]) AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], - [AliLog::AliLogNotification fct])], - [have_alilog_notification=yes], - [AC_DEFINE(NO_ALILOG_NOTIFICATION)]) + [AliLog* logger=AliLog::GetRootLogger();])], + [have_alilog_notification=yes], + [AC_DEFINE(NO_ALILOG_GETROOTLOGGER) + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [AliLog::AliLogNotification fct])], + [have_alilog_notification=yes], + [AC_DEFINE(NO_ALILOG_NOTIFICATION)]) + ]) AC_MSG_RESULT([$have_alilog_notification]) fi diff --git a/HLT/rec/AliHLTDynamicAliLog.cxx b/HLT/rec/AliHLTDynamicAliLog.cxx index 5ae47775ac4..88d29c94edf 100644 --- a/HLT/rec/AliHLTDynamicAliLog.cxx +++ b/HLT/rec/AliHLTDynamicAliLog.cxx @@ -134,7 +134,11 @@ extern "C" int InitAliDynamicMessageCallback() // older versions of AliLog does not support the notification callback and // stringstreams, but they support the logging macros in general #ifndef NO_ALILOG_NOTIFICATION +#ifndef NO_ALILOG_GETROOTLOGGER AliLog* log = AliLog::GetRootLogger(); +#else + AliLog* log = new AliLog; +#endif //NO_ALILOG_GETROOTLOGGER log->SetLogNotification(LogNotification); log->SetStreamOutput(&AliHLTLogging::fgLogstr); log->SetPrintScope(true); -- 2.43.0