@@ -149,17 +149,17 @@ void LogHelper::DoLog() noexcept {
149149}
150150
151151void LogHelper::InternalLoggingError (std::string_view message) noexcept {
152+ std::string exc_info;
152153 try {
154+ exc_info = boost::current_exception_diagnostic_information ();
153155 // Use fmt::format to output the message without interleaving with other logs.
154- std::fputs (
155- fmt::format (" LogHelper: {}. {}\n " , message, boost::current_exception_diagnostic_information ()).c_str (),
156- stderr
157- );
156+ std::fputs (fmt::format (" LogHelper: {}. {}\n " , message, exc_info).c_str (), stderr);
158157 } catch (...) {
159158 // ignore
159+ exc_info = " unknown" ; // fits into SSO
160160 }
161161 pimpl_->MarkAsBroken ();
162- UASSERT_MSG (false , message);
162+ UASSERT_MSG (false , fmt::format ( " {}: {} " , message, exc_info) );
163163}
164164
165165impl::TagWriter LogHelper::GetTagWriter () { return impl::TagWriter{*this }; }
@@ -271,7 +271,7 @@ LogHelper& LogHelper::PutTag(std::string_view key, const LogExtra::Value& value)
271271 try {
272272 pimpl_->AddTag (key, value);
273273 } catch (...) {
274- InternalLoggingError (" Failed to extend log with LogExtra&& " );
274+ InternalLoggingError (" Failed to extend log with Value " );
275275 }
276276 return *this ;
277277}
@@ -280,7 +280,7 @@ LogHelper& LogHelper::PutSwTag(std::string_view key, std::string_view value) noe
280280 try {
281281 pimpl_->AddTag (key, value);
282282 } catch (...) {
283- InternalLoggingError (" Failed to extend log with LogExtra&& " );
283+ InternalLoggingError (" Failed to extend log with std::string_view " );
284284 }
285285 return *this ;
286286}
0 commit comments