예제 #1
0
data::colored_string console_displayer::format_frame(const data::frame& f_)
{
  data::colored_string prefix;
  if (f_.is_profiled())
  {
    prefix = "[" + format_time(f_.time_taken()) + ", " +
             format_ratio(f_.time_taken_ratio()) + "] ";
  }

  std::ostringstream postfix;
  if (f_.is_full())
  {
    postfix << " at " << f_.source_location() << " (" << f_.kind() << " from "
            << f_.point_of_instantiation() << ")";
  }
  return prefix + format_code(f_.type().name()) + postfix.str();
}
예제 #2
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();
}