From 09e4d63ba02d271a90a6d6535e4325a60623f919 Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Mon, 19 Oct 2009 12:53:36 +0000 Subject: [PATCH] bug 1303: do not add a newline by default when sending a timer to a stream --- LCS/Common/include/Common/Timer.h | 2 +- LCS/Common/src/Timer.cc | 4 ---- LCS/Common/test/tTimer.cc | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/LCS/Common/include/Common/Timer.h b/LCS/Common/include/Common/Timer.h index 33451ef80e5..bc95661c4ad 100644 --- a/LCS/Common/include/Common/Timer.h +++ b/LCS/Common/include/Common/Timer.h @@ -144,7 +144,7 @@ namespace LOFAR { std::stringstream logStr; LOG_DEBUG_STR(print(logStr).rdbuf()); } else - print(std::clog); + std::clog << *this << std::endl; } } diff --git a/LCS/Common/src/Timer.cc b/LCS/Common/src/Timer.cc index 74d892a9dec..231dfcb962c 100644 --- a/LCS/Common/src/Timer.cc +++ b/LCS/Common/src/Timer.cc @@ -98,8 +98,6 @@ ostream &NSTimer::print(ostream &str) const } if (count == 0) { str << "not used"; - if (!log_on_destruction) - str << endl; } else { double total = static_cast<double>(total_time); if (CPU_speed_in_MHz == 0) { @@ -111,8 +109,6 @@ ostream &NSTimer::print(ostream &str) const << ", total = " << PrettyTime(total); } str << ", count = " << setw(9) << count; - if (!log_on_destruction) - str << endl; } return str; } diff --git a/LCS/Common/test/tTimer.cc b/LCS/Common/test/tTimer.cc index b810028ce1e..8c26b672132 100644 --- a/LCS/Common/test/tTimer.cc +++ b/LCS/Common/test/tTimer.cc @@ -49,7 +49,7 @@ int main() timer.stop(); } - std::cout << timer; + std::cout << timer << std::endl; return 0; } -- GitLab