@@ -117,6 +117,10 @@ json::Value ProgressEvent::ToJSON() const {
117
117
body.try_emplace (" cancellable" , false );
118
118
}
119
119
120
+ if (m_event_type == progressUpdate) {
121
+ EmplaceSafeString (body, " message" , m_message);
122
+ }
123
+
120
124
std::string timestamp (llvm::formatv (" {0:f9}" , m_creation_time.count ()));
121
125
EmplaceSafeString (body, " timestamp" , timestamp);
122
126
@@ -164,10 +168,11 @@ const ProgressEvent &ProgressEventManager::GetMostRecentEvent() const {
164
168
return m_last_update_event ? *m_last_update_event : m_start_event;
165
169
}
166
170
167
- void ProgressEventManager::Update (uint64_t progress_id, uint64_t completed,
168
- uint64_t total) {
169
- if (std::optional<ProgressEvent> event = ProgressEvent::Create (
170
- progress_id, std::nullopt, completed, total, &GetMostRecentEvent ())) {
171
+ void ProgressEventManager::Update (uint64_t progress_id, const char *message,
172
+ uint64_t completed, uint64_t total) {
173
+ if (std::optional<ProgressEvent> event =
174
+ ProgressEvent::Create (progress_id, StringRef (message), completed,
175
+ total, &GetMostRecentEvent ())) {
171
176
if (event->GetEventType () == progressEnd)
172
177
m_finished = true ;
173
178
@@ -227,7 +232,7 @@ void ProgressEventReporter::Push(uint64_t progress_id, const char *message,
227
232
m_unreported_start_events.push (event_manager);
228
233
}
229
234
} else {
230
- it->second ->Update (progress_id, completed, total);
235
+ it->second ->Update (progress_id, message, completed, total);
231
236
if (it->second ->Finished ())
232
237
m_event_managers.erase (it);
233
238
}
0 commit comments