@@ -117,6 +117,10 @@ json::Value ProgressEvent::ToJSON() const {
117117 body.try_emplace (" cancellable" , false );
118118 }
119119
120+ if (m_event_type == progressUpdate) {
121+ EmplaceSafeString (body, " message" , m_message);
122+ }
123+
120124 std::string timestamp (llvm::formatv (" {0:f9}" , m_creation_time.count ()));
121125 EmplaceSafeString (body, " timestamp" , timestamp);
122126
@@ -164,10 +168,11 @@ const ProgressEvent &ProgressEventManager::GetMostRecentEvent() const {
164168 return m_last_update_event ? *m_last_update_event : m_start_event;
165169}
166170
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 ())) {
171176 if (event->GetEventType () == progressEnd)
172177 m_finished = true ;
173178
@@ -227,7 +232,7 @@ void ProgressEventReporter::Push(uint64_t progress_id, const char *message,
227232 m_unreported_start_events.push (event_manager);
228233 }
229234 } else {
230- it->second ->Update (progress_id, completed, total);
235+ it->second ->Update (progress_id, message, completed, total);
231236 if (it->second ->Finished ())
232237 m_event_managers.erase (it);
233238 }
0 commit comments