]> https://gitweb.dealii.org/ - dealii.git/commitdiff
attach cerr to LogStream
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Thu, 11 Dec 2003 20:24:05 +0000 (20:24 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Thu, 11 Dec 2003 20:24:05 +0000 (20:24 +0000)
git-svn-id: https://svn.dealii.org/trunk@8258 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/logstream.h
deal.II/base/source/log.cc

index 278d636c22d1839b5da95212bd3a82230ce15baa..b59badcdaf3966c2aefdb4ceb810b7b5a162a569 100644 (file)
@@ -87,6 +87,11 @@ class LogStream
                                      */
     std::ostream& get_file_stream ();
 
+                                    /**
+                                     * Reroutes cerr to LogStream.
+                                     */
+    void log_cerr ();
+    
                                     /**
                                      * Return the prefix string.
                                      */
index b1fa60f5cc52217c9732d2a6dee1a208aff1e627..41b0ca5fb8173e7ad8ab6ef2e9eb7c81575555a0 100644 (file)
@@ -72,6 +72,12 @@ void LogStream::detach ()
 }
 
 
+void LogStream::log_cerr ()
+{
+  std::cerr.rdbuf(file->rdbuf());
+}
+
+
 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.