From a45599b4df17d8a9d4c693507e419dc2a75ddca0 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 13 Aug 2017 12:03:07 -0500 Subject: [PATCH] LogStream: Remove log_cerr --- include/deal.II/base/logstream.h | 14 -------------- source/base/logstream.cc | 19 ------------------- 2 files changed, 33 deletions(-) diff --git a/include/deal.II/base/logstream.h b/include/deal.II/base/logstream.h index 283e7bca98..6a8d04bd84 100644 --- a/include/deal.II/base/logstream.h +++ b/include/deal.II/base/logstream.h @@ -181,13 +181,6 @@ public: bool has_file () const; - /** - * Reroutes cerr to LogStream. Works as a switch, turning logging of - * cerr on and off alternatingly with every call. - */ - void log_cerr (); - - /** * Return the prefix string. */ @@ -393,13 +386,6 @@ private: */ struct tms reference_tms; - /** - * Original buffer of std::cerr. We store the address of that - * buffer when #log_cerr is called, and reset it to this value if #log_cerr - * is called a second time, or when the destructor of this class is run. - */ - std::streambuf *old_cerr; - /** * A flag indicating whether output is currently at a new line */ diff --git a/source/base/logstream.cc b/source/base/logstream.cc index fcd2b45a51..94ebc8f78c 100644 --- a/source/base/logstream.cc +++ b/source/base/logstream.cc @@ -55,7 +55,6 @@ LogStream::LogStream() diff_utime(false), last_time (0.), print_thread_id(false), - old_cerr(nullptr), at_newline(true) { get_prefixes().push("DEAL:"); @@ -100,9 +99,6 @@ LogStream::~LogStream() *this << std::endl; } } - - if (old_cerr) - std::cerr.rdbuf(old_cerr); } @@ -214,21 +210,6 @@ void LogStream::detach () } -void LogStream::log_cerr () -{ - Threads::Mutex::ScopedLock lock(log_lock); - if (old_cerr == nullptr) - { - old_cerr = std::cerr.rdbuf(file->rdbuf()); - } - else - { - std::cerr.rdbuf(old_cerr); - old_cerr = nullptr; - } -} - - std::ostream & LogStream::get_console() { -- 2.39.5