32 std::mutex write_lock;
69 "An exception occurred in LogStream::Prefix::~Prefix."));
111 *
std_out << (
"You still have content that was written to 'deallog' "
112 "but not flushed to the screen or a file while the "
113 "program is being terminated. This would lead to a "
114 "segmentation fault. Make sure you flush the "
115 "content of the 'deallog' object using 'std::endl' "
116 "before the end of the program.")
151 class QueryStreambuf :
public std::streambuf
158 , newline_written_(
false)
168 return newline_written_;
173 overflow(int_type ch)
override
175 newline_written_ =
true;
185 bool newline_written_;
190 std::ostream inject(&query_streambuf);
194 if (query_streambuf.flushed())
196 std::lock_guard<std::mutex> lock(write_lock);
202 at_newline = query_streambuf.newline_written();
208 *
file << stream.str() << std::flush;
220 const bool print_job_id,
221 const std::ios_base::fmtflags flags)
223 std::lock_guard<std::mutex> lock(log_lock);
234 std::lock_guard<std::mutex> lock(log_lock);
261 outstreams.
get()->setf(std::ios::showpoint | std::ios::left);
274 ExcMessage(
"You can't ask for the std::ostream object for the output "
275 "file if none had been set before."));
284 return (
file !=
nullptr);
292 static std::string empty_string;
310 pre += std::string(
":");
352 std::lock_guard<std::mutex> lock(log_lock);
363 std::lock_guard<std::mutex> lock(log_lock);
374 std::lock_guard<std::mutex> lock(log_lock);
382std::stack<std::string> &
386 std::stack<std::string> &local_prefixes =
prefixes.
get(exists);
394 local_prefixes = it->second;
397 return local_prefixes;
406 const std::thread::id thread = std::this_thread::get_id();
411 *
std_out <<
'[' << thread <<
']';
420 *
file <<
'[' << thread <<
']';
423 *
file << head <<
':';
static const JobIdentifier & get_dealjobid()
SmartPointer< LogStream, LogStream::Prefix > stream
Prefix(const std::string &text)
std::thread::id parent_thread
std::streamsize width(const std::streamsize wide)
std::ostream & get_console()
friend LogStream & operator<<(LogStream &log, const T &t)
void push(const std::string &text)
Threads::ThreadLocalStorage< std::shared_ptr< std::ostringstream > > outstreams
std::ios::fmtflags flags(const std::ios::fmtflags f)
void attach(std::ostream &o, const bool print_job_id=true, const std::ios_base::fmtflags flags=std::ios::showpoint|std::ios::left)
std::streamsize precision(const std::streamsize prec)
std::ostream & get_file_stream()
unsigned int depth_console(const unsigned int n)
std::ostringstream & get_stream()
unsigned int depth_file(const unsigned int n)
bool log_thread_id(const bool flag)
Threads::ThreadLocalStorage< std::stack< std::string > > prefixes
std::stack< std::string > & get_prefixes() const
const std::string & get_prefix() const
std::map< std::thread::id, T > data
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
#define AssertNothrow(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)