From f05c614fac0b0dfb5280c5258ed26806f9603753 Mon Sep 17 00:00:00 2001
From: Ger van Diepen <diepen@astron.nl>
Date: Mon, 14 Nov 2011 08:32:47 +0000
Subject: [PATCH] Task #514 Removed superfluous endl

---
 LCS/ACC/PLC/src/ProcControlServer.cc       | 2 +-
 LCS/Common/include/Common/LofarLog4Cplus.h | 4 ++++
 LCS/Common/include/Common/LofarLog4Cxx.h   | 4 ++++
 LCS/Common/include/Common/LofarLogCout.h   | 6 +++++-
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/LCS/ACC/PLC/src/ProcControlServer.cc b/LCS/ACC/PLC/src/ProcControlServer.cc
index 576ca9677ad..30f5b5b3dce 100644
--- a/LCS/ACC/PLC/src/ProcControlServer.cc
+++ b/LCS/ACC/PLC/src/ProcControlServer.cc
@@ -99,7 +99,7 @@ bool ProcControlServer::handleMessage(DH_ProcControl*	theMsg)
 	int16	cmdType 	 = theMsg->getCommand();
 	string	options		 = theMsg->getOptions();
 	LOG_DEBUG_STR("handleMessage: calling " << PCCmdName(theMsg->getCommand()) <<
-				  "(" << options << ")" << endl);
+				  "(" << options << ")");
 
 	// setup control defaults
 	bool	sendAnswer = true;		// assume that answer must be send
diff --git a/LCS/Common/include/Common/LofarLog4Cplus.h b/LCS/Common/include/Common/LofarLog4Cplus.h
index e6e5932e00a..7a4d68c5128 100644
--- a/LCS/Common/include/Common/LofarLog4Cplus.h
+++ b/LCS/Common/include/Common/LofarLog4Cplus.h
@@ -27,6 +27,7 @@
 // Interface to the log4cplus logging package.
 
 //# Includes
+#include <Common/CasaLogSink.h>
 #include <Common/lofar_iostream.h>
 #include <Common/lofar_sstream.h>
 #include <Common/lofar_string.h>
@@ -63,11 +64,13 @@ namespace LOFAR {
 #define INIT_LOGGER(filename)                   \
   do {                                          \
     ::LOFAR::initLog4Cplus(filename);           \
+    ::LOFAR::CasaLogSink::attach();             \
   } while(0)
 
 #define INIT_VAR_LOGGER(filename,logfile)                 \
   do {                                                    \
     ::LOFAR::initLog4Cplus(filename, logfile);            \
+    ::LOFAR::CasaLogSink::attach();                       \
   } while(0)
   
 // After initialisation a thread is started to monitor any changes in the
@@ -76,6 +79,7 @@ namespace LOFAR {
 # define INIT_LOGGER_AND_WATCH(filename,watchinterval)        \
   do {                                                        \
     ::LOFAR::initLog4CplusAndWatch(filename, watchinterval);  \
+    ::LOFAR::CasaLogSink::attach();                           \
   } while(0)
 #else
 # define INIT_LOGGER_AND_WATCH(filename,watchinterval) INIT_LOGGER(filename)
diff --git a/LCS/Common/include/Common/LofarLog4Cxx.h b/LCS/Common/include/Common/LofarLog4Cxx.h
index 7d928e3ee07..b4384970c93 100644
--- a/LCS/Common/include/Common/LofarLog4Cxx.h
+++ b/LCS/Common/include/Common/LofarLog4Cxx.h
@@ -27,6 +27,7 @@
 // Interface to the log4cxx logging package.
 
 //# Includes
+#include <Common/CasaLogSink.h>
 #include <Common/lofar_iostream.h>
 #include <Common/lofar_sstream.h>
 #include <Common/lofar_string.h>
@@ -64,11 +65,13 @@ namespace LOFAR {
 #define INIT_LOGGER(filename)                   \
   do {                                          \
     ::LOFAR::initLog4Cxx(filename);             \
+    ::LOFAR::CasaLogSink::attach();             \
   } while(0)
 
 #define INIT_VAR_LOGGER(filename,logfile)       \
   do {                                          \
     ::LOFAR::initLog4Cxx(filename, logfile);    \
+    ::LOFAR::CasaLogSink::attach();             \
   } while(0)
 
 // After initialisation a thread is started to monitor any changes in the
@@ -77,6 +80,7 @@ namespace LOFAR {
 # define INIT_LOGGER_AND_WATCH(filename,watchinterval)      \
   do {                                                      \
     ::LOFAR::initLog4CxxAndWatch(filename, watchinterval);  \
+    ::LOFAR::CasaLogSink::attach();                         \
   } while(0)
 #else
 # define INIT_LOGGER_AND_WATCH(filename,watchinterval) INIT_LOGGER(filename)
diff --git a/LCS/Common/include/Common/LofarLogCout.h b/LCS/Common/include/Common/LofarLogCout.h
index 8416619dc24..70af5641022 100644
--- a/LCS/Common/include/Common/LofarLogCout.h
+++ b/LCS/Common/include/Common/LofarLogCout.h
@@ -27,6 +27,7 @@
 // Macro interface to the cout/cerr logging implementation.
 
 
+#include <Common/CasaLogSink.h>
 #include <Common/lofar_iostream.h>
 #include <Common/lofar_sstream.h>
 #include <Common/lofar_iomanip.h>
@@ -53,7 +54,10 @@
 //	- INIT_LOGGER_AND_WATCH
 //
 #define INIT_LOGGER(filename) \
-	::LOFAR::LFDebug::initLevels (::LOFAR::string(filename) + ".debug")
+  do {                                          \
+    ::LOFAR::LFDebug::initLevels (::LOFAR::string(filename) + ".debug"); \
+    ::LOFAR::CasaLogSink::attach();             \
+  } while(0)
 
 //# Note: 'var' logger functionality not available
 #define INIT_VAR_LOGGER(filename,logfile) \
-- 
GitLab