Example #1
0
data::colored_string console_displayer::format_frame(const data::frame& f_)
{
  data::colored_string prefix;
  if (const auto t = f_.time_taken())
  {
    const auto r = f_.time_taken_ratio();
    assert(bool(r));
    prefix = "[" + format_time(*t) + ", " + format_ratio(*r) + "] ";
  }

  std::ostringstream postfix;
  if (f_.is_full())
  {
    postfix << " at " << f_.source_location() << " (" << f_.kind() << " from "
            << f_.point_of_event() << ")";
  }
  return prefix + format_metaprogram_node(f_.node()) + postfix.str();
}