2 #include "tbb/concurrent_unordered_map.h" 12 std::ostringstream oss;
14 << std::this_thread::get_id() <<
std::left <<
" ";
24 std::ostringstream oss;
35 auto const begin_fcn_name = pretty_fcn_name.rfind(fcn_name);
36 auto const begin_qualified_fcn_name =
37 pretty_fcn_name.find_last_of(
' ', begin_fcn_name);
39 begin_qualified_fcn_name > begin_fcn_name ? 0 : begin_qualified_fcn_name;
41 if (
auto const stripped_begin = pretty_fcn_name.find(
"art::",
begin);
42 stripped_begin != std::string::npos) {
43 begin = stripped_begin + 5;
45 auto const substr_length = begin_fcn_name -
begin;
46 return pretty_fcn_name.substr(begin, substr_length) + fcn_name;
49 tbb::concurrent_unordered_map<art::ScheduleID, unsigned> indents;
54 auto it = indents.insert(std::make_pair(sid, 0)).first;
55 if (step ==
"Begin") {
56 auto const printed = it->second;
59 }
else if (step ==
"End") {
60 auto const printed = --it->second;
84 buffer_ << banner(banner_prefix) << schedule_to_str(sid) <<
" " 85 << indent_for(step, sid) << std::left <<
std::setw(6) << step
86 << trimmed(fcn_name, pretty_fcn_name);
91 auto const user_message = usr_msg_.str();
92 if (not
empty(user_message)) {
93 buffer_ <<
" - " << user_message;
96 std::cerr << buffer_.str();
MessageAccumulator(char const banner_prefix, std::string const &fcn_name, std::string const &pretty_fcn_name, ScheduleID schedule_id=ScheduleID{}, std::string const &step=std::string(6, ' '))
DebugTasksValue debugTasks
std::atomic< int > value_
std::string getenv(std::string const &name)
Q_EXPORT QTSManip setw(int w)
std::atomic< char const * > cvalue_
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Q_EXPORT QTSManip setfill(int f)
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.