]> https://gitweb.dealii.org/ - dealii.git/commitdiff
LogStream: Remove log_cerr
authorMatthias Maier <tamiko@43-1.org>
Sun, 13 Aug 2017 17:03:07 +0000 (12:03 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sun, 13 Aug 2017 18:33:53 +0000 (13:33 -0500)
include/deal.II/base/logstream.h
source/base/logstream.cc

index 283e7bca987551ae02c38d4cf267078c90e634f6..6a8d04bd84a981cd60e16709217f5981258087a2 100644 (file)
@@ -181,13 +181,6 @@ public:
   bool has_file () const;
 
 
-  /**
-   * Reroutes cerr to LogStream. Works as a switch, turning logging of
-   * <tt>cerr</tt> 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 <tt>std::cerr</tt>. 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
    */
index fcd2b45a51671739aa3eb55190bf0d1ed893c7f5..94ebc8f78c6cf1f9518858f1a28f504587c2071f 100644 (file)
@@ -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()
 {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.