diff --git a/LCS/Common/include/Common/LofarLog4Cplus.h b/LCS/Common/include/Common/LofarLog4Cplus.h index e27580f73784773fdc21baa74642485b4caae484..0d8b4a97cba4d5f4fbe6a9dcb6fefd34c3627176 100644 --- a/LCS/Common/include/Common/LofarLog4Cplus.h +++ b/LCS/Common/include/Common/LofarLog4Cplus.h @@ -249,20 +249,18 @@ namespace LOFAR { // Create a TraceLogger object that will output your message during construct // and destruction. Your message is preceeded with "ENTER:" or "EXIT:". -#define LOG_TRACE_LIFETIME(level,message) do { \ +#define LOG_TRACE_LIFETIME(level,message) \ ::LOFAR::LifetimeLogger _tmpLifetimeTraceObj(level, getLogger().logger(), \ ::LOFAR::formatString("%s:%s", AUTO_FUNCTION_NAME, message), \ - __FILE__, __LINE__); \ - } while(0) + __FILE__, __LINE__); // Create a TraceLogger object that will output your message during construct // and destruction. Your message is preceeded with "ENTER:" or "EXIT:". -#define LOG_TRACE_LIFETIME_STR(level,stream) do { \ +#define LOG_TRACE_LIFETIME_STR(level,stream) \ std::ostringstream oss; \ oss << AUTO_FUNCTION_NAME << ":" << stream; \ ::LOFAR::LifetimeLogger _tmpLifetimeTraceObj(level, getLogger().logger(), \ - oss.str(), __FILE__, __LINE__); \ - } while(0) + oss.str(), __FILE__, __LINE__); //# ----------- implementation details tracer part ------------- diff --git a/LCS/Common/include/Common/LofarLogCout.h b/LCS/Common/include/Common/LofarLogCout.h index c4f44d93d11d4ab776420117b0480472bd45233f..48e3924b313e73efde9dd6731adb512e163d5fa3 100644 --- a/LCS/Common/include/Common/LofarLogCout.h +++ b/LCS/Common/include/Common/LofarLogCout.h @@ -136,14 +136,13 @@ public: \ //# //# LOG_TRACE_LIFETIME(_STR) (level, message|stream) //# -#define LOG_TRACE_LIFETIME_STR(level, stream) do { \ +#define LOG_TRACE_LIFETIME_STR(level, stream) \ if( LFDebugCheck(level) ) { \ ::LOFAR::LFDebug::Tracer objname; \ constructStream(stream); \ objname.startMsg (LOG4CPLUS_LEVEL(level), __FILE__, __LINE__, \ AUTO_FUNCTION_NAME, oss.str().c_str(), 0); \ - } \ - } while(0) + } #define LOG_TRACE_LIFETIME(level,message) \ LOG_TRACE_LIFETIME_STR(level, message)