Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/util/timestamper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ std::string monotonic_timestampert::stamp() const
std::lldiv_t divmod = lldiv(cnt, 1000000);

std::stringstream ss;
ss << divmod.quot << "." << std::setfill('0') << std::setw(6) << divmod.rem
<< " ";
ss << divmod.quot << "." << std::setfill('0') << std::setw(6) << divmod.rem;
return ss.str();
}

Expand All @@ -67,7 +66,7 @@ std::string wall_clock_timestampert::stamp() const

std::stringstream ss;
ss << std::put_time(&local, WALL_FORMAT) << std::setfill('0') << std::setw(6)
<< u_seconds << " ";
<< u_seconds;
return ss.str();
}
#endif
9 changes: 8 additions & 1 deletion src/util/ui_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ void ui_message_handlert::print(
{
console_message_handlert console_message_handler;
std::stringstream ss;
ss << time->stamp() << message;
const std::string timestamp = time->stamp();
ss << timestamp << (timestamp.empty() ? "" : " ") << message;
console_message_handler.print(level, ss.str());
}
break;
Expand Down Expand Up @@ -244,6 +245,9 @@ void ui_message_handlert::xml_ui_msg(

result.new_element("text").data=msg1;
result.set_attribute("type", type);
const std::string timestamp = time->stamp();
if(!timestamp.empty())
result.set_attribute("timestamp", timestamp);

std::cout << result;
std::cout << '\n';
Expand All @@ -263,6 +267,9 @@ void ui_message_handlert::json_ui_msg(

result["messageType"] = json_stringt(type);
result["messageText"] = json_stringt(msg1);
const std::string timestamp = time->stamp();
if(!timestamp.empty())
result["timestamp"] = json_stringt(timestamp);

// By convention a leading comma is created by every new array entry.
// The first entry is generated in the constructor and does not have
Expand Down