File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,7 @@ std::string monotonic_timestampert::stamp() const
47
47
std::lldiv_t divmod = lldiv (cnt, 1000000 );
48
48
49
49
std::stringstream ss;
50
- ss << divmod.quot << " ." << std::setfill (' 0' ) << std::setw (6 ) << divmod.rem
51
- << " " ;
50
+ ss << divmod.quot << " ." << std::setfill (' 0' ) << std::setw (6 ) << divmod.rem ;
52
51
return ss.str ();
53
52
}
54
53
@@ -67,7 +66,7 @@ std::string wall_clock_timestampert::stamp() const
67
66
68
67
std::stringstream ss;
69
68
ss << std::put_time (&local, WALL_FORMAT) << std::setfill (' 0' ) << std::setw (6 )
70
- << u_seconds << " " ;
69
+ << u_seconds;
71
70
return ss.str ();
72
71
}
73
72
#endif
Original file line number Diff line number Diff line change @@ -110,7 +110,8 @@ void ui_message_handlert::print(
110
110
{
111
111
console_message_handlert console_message_handler;
112
112
std::stringstream ss;
113
- ss << time ->stamp () << message;
113
+ const std::string timestamp = time ->stamp ();
114
+ ss << timestamp << (timestamp.empty () ? " " : " " ) << message;
114
115
console_message_handler.print (level, ss.str ());
115
116
}
116
117
break ;
@@ -244,6 +245,9 @@ void ui_message_handlert::xml_ui_msg(
244
245
245
246
result.new_element (" text" ).data =msg1;
246
247
result.set_attribute (" type" , type);
248
+ const std::string timestamp = time ->stamp ();
249
+ if (!timestamp.empty ())
250
+ result.set_attribute (" timestamp" , timestamp);
247
251
248
252
std::cout << result;
249
253
std::cout << ' \n ' ;
@@ -263,6 +267,9 @@ void ui_message_handlert::json_ui_msg(
263
267
264
268
result[" messageType" ] = json_stringt (type);
265
269
result[" messageText" ] = json_stringt (msg1);
270
+ const std::string timestamp = time ->stamp ();
271
+ if (!timestamp.empty ())
272
+ result[" timestamp" ] = json_stringt (timestamp);
266
273
267
274
// By convention a leading comma is created by every new array entry.
268
275
// The first entry is generated in the constructor and does not have
You can’t perform that action at this time.
0 commit comments