32 std::mutex write_lock;
69 "An exception occurred in LogStream::Prefix::~Prefix."));
110 *
std_out << (
"You still have content that was written to 'deallog' "
111 "but not flushed to the screen or a file while the "
112 "program is being terminated. This would lead to a "
113 "segmentation fault. Make sure you flush the "
114 "content of the 'deallog' object using 'std::endl' "
115 "before the end of the program.")
150 class QueryStreambuf :
public std::streambuf
157 , newline_written_(
false)
167 return newline_written_;
174 newline_written_ =
true;
184 bool newline_written_;
189 std::ostream inject(&query_streambuf);
193 if (query_streambuf.flushed())
195 std::lock_guard<std::mutex> lock(write_lock);
201 at_newline = query_streambuf.newline_written();
207 *
file << stream.str() << std::flush;
219 const bool print_job_id,
220 const std::ios_base::fmtflags flags)
222 std::lock_guard<std::mutex> lock(log_lock);
233 std::lock_guard<std::mutex> lock(log_lock);
260 outstreams.
get()->setf(std::ios::showpoint | std::ios::left);
273 ExcMessage(
"You can't ask for the std::ostream object for the output "
274 "file if none had been set before."));
283 return (
file !=
nullptr);
291 static std::string empty_string;
309 pre += std::string(
":");
351 std::lock_guard<std::mutex> lock(log_lock);
362 std::lock_guard<std::mutex> lock(log_lock);
373 std::lock_guard<std::mutex> lock(log_lock);
381 std::stack<std::string> &
384 #ifdef DEAL_II_WITH_THREADS
386 std::stack<std::string> &local_prefixes =
prefixes.
get(exists);
392 const tbb::enumerable_thread_specific<std::stack<std::string>> &impl =
397 const tbb::enumerable_thread_specific<
398 std::stack<std::string>>::const_iterator first_elem = impl.begin();
400 if (first_elem != impl.end())
402 local_prefixes = *first_elem;
406 return local_prefixes;
419 const std::thread::id thread = std::this_thread::get_id();
424 *
std_out <<
'[' << thread <<
']';
433 *
file <<
'[' << thread <<
']';
436 *
file << head <<
':';