17 #ifndef __deal2__logstream_h 18 #define __deal2__logstream_h 20 #include <deal.II/base/config.h> 22 #include <deal.II/base/smartpointer.h> 23 #include <deal.II/base/std_cxx1x/shared_ptr.h> 24 #include <deal.II/base/thread_local_storage.h> 32 #ifdef HAVE_SYS_TIMES_H 33 # include <sys/times.h> 37 int tms_utime, tms_stime, tms_cutime, tms_cstime;
144 Prefix(
const std::string &text);
150 Prefix(
const std::string &text,
182 void attach (std::ostream &o,
183 const bool print_job_id =
true);
204 void test_mode (
bool on=
true);
210 std::ostream &get_console ();
216 std::ostream &get_file_stream ();
222 bool has_file ()
const;
235 const std::string &get_prefix ()
const;
245 void push (
const std::string &text);
262 unsigned int depth_console (
const unsigned int n);
273 unsigned int depth_file (
const unsigned int n);
282 bool log_execution_time (
const bool flag);
297 bool log_time_differences (
const bool flag);
309 bool log_thread_id (
const bool flag);
331 void threshold_double(
const double t);
337 void threshold_float(
const float t);
345 std::streamsize precision (
const std::streamsize prec);
353 std::streamsize width (
const std::streamsize wide);
361 std::ios::fmtflags flags(
const std::ios::fmtflags f);
407 std::size_t memory_consumption ()
const;
425 std::stack<std::string> &get_prefixes()
const;
539 void print_line_head ();
546 std::ostringstream &get_stream();
568 template <
typename T>
590 if (outstreams.get().get() == 0)
592 outstreams.get().reset (
new std::ostringstream);
593 outstreams.get()->setf(std::ios::showpoint | std::ios::left);
597 return *outstreams.get();
607 std::ostringstream &stream = get_stream();
613 if (! (t<=0) && !(t>=0))
615 else if (std::fabs(t) < double_threshold)
618 stream << t*(1.+offset);
629 std::ostringstream &stream = get_stream();
635 if (! (t<=0) && !(t>=0))
637 else if (std::fabs(t) < float_threshold)
640 stream << t*(1.+offset);
679 DEAL_II_NAMESPACE_CLOSE
Threads::ThreadLocalStorage< std_cxx1x::shared_ptr< std::ostringstream > > outstreams
A class that provides a separate storage location on each thread that accesses the object...
Threads::ThreadLocalStorage< std::stack< std::string > > prefixes
std::streambuf * old_cerr
LogStream & operator<<(const double t)
#define DeclException0(Exception0)
Prefix(const std::string &text)
std::ostream & operator<<(std::ostream &os, const Vector< number > &v)
double reference_time_val
std::ostringstream & get_stream()