From 9d063d8c9ced0c769385bf252f610577abb8acd9 Mon Sep 17 00:00:00 2001 From: Anthony West Date: Tue, 6 Oct 2026 06:28:05 -0700 Subject: [PATCH 01/38] Bump version to 0.85.0-dev.1 --- ASWLog/ASWLog_Version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ASWLog/ASWLog_Version.h b/ASWLog/ASWLog_Version.h index 298c254..663dddc 100644 --- a/ASWLog/ASWLog_Version.h +++ b/ASWLog/ASWLog_Version.h @@ -34,10 +34,10 @@ limitations under the License. // ASWLOG_VERSION_STRING is "MAJOR.MINOR.PATCH", followed by "-PRERELEASE" if the pre-release isn't empty; change // them together (a unit test checks that they match). #define ASWLOG_VERSION_MAJOR 0 -#define ASWLOG_VERSION_MINOR 75 +#define ASWLOG_VERSION_MINOR 85 #define ASWLOG_VERSION_PATCH 0 -#define ASWLOG_VERSION_PRERELEASE "" -#define ASWLOG_VERSION_STRING "0.75.0" +#define ASWLOG_VERSION_PRERELEASE "dev.1" +#define ASWLOG_VERSION_STRING "0.85.0-dev.1" namespace ASWLog { From 275e0e118b06829a0a4a25488c46eddd6683d1a2 Mon Sep 17 00:00:00 2001 From: Anthony West Date: Tue, 6 Oct 2026 07:21:23 -0700 Subject: [PATCH 02/38] Format the default line's fields without std::format Tests showed a ~60% improved meta-data line build speed --- ASWLog/ASWLog_CrashHandler.cpp | 23 ++----- ASWLog/ASWLog_Formatter.cpp | 50 +++++++++++++-- ASWLog/ASWLog_Utils.cpp | 92 +++++++++++++++++---------- ASWLog/ASWLog_Utils.h | 15 +++++ CHANGELOG.md | 14 ++++ tests/tests/Test_ASWLog_Formatter.cpp | 37 +++++++++++ tests/tests/Test_ASWLog_Formatter.h | 1 + tests/tests/Test_ASWLog_Utils.cpp | 38 +++++++++++ tests/tests/Test_ASWLog_Utils.h | 1 + 9 files changed, 213 insertions(+), 58 deletions(-) diff --git a/ASWLog/ASWLog_CrashHandler.cpp b/ASWLog/ASWLog_CrashHandler.cpp index e6c2217..5adae5a 100644 --- a/ASWLog/ASWLog_CrashHandler.cpp +++ b/ASWLog/ASWLog_CrashHandler.cpp @@ -47,6 +47,7 @@ limitations under the License. #endif //--------------------------------------------------------------------------- #include "ASWLog_TextLogBase.h" +#include "ASWLog_Utils.h" //--------------------------------------------------------------------------- namespace ASWLog @@ -592,25 +593,9 @@ void TCrashText::AppendHex(std::uint64_t value, int minDigits) noexcept //--------------------------------------------------------------------------- void TCrashText::AppendISO8601(std::chrono::system_clock::time_point time) noexcept { - // Calendar arithmetic only, which doesn't allocate (unlike Time::ToISO8601String()) - const auto day = std::chrono::floor(time); - const std::chrono::year_month_day date{ day }; - const auto milliseconds = std::chrono::duration_cast(time - day).count(); - - AppendDecimal(static_cast(static_cast(date.year())), 4); - Append("-"); - AppendDecimal(static_cast(date.month()), 2); - Append("-"); - AppendDecimal(static_cast(date.day()), 2); - Append("T"); - AppendDecimal(static_cast(milliseconds / 3600000), 2); - Append(":"); - AppendDecimal(static_cast(milliseconds / 60000 % 60), 2); - Append(":"); - AppendDecimal(static_cast(milliseconds / 1000 % 60), 2); - Append("."); - AppendDecimal(static_cast(milliseconds % 1000), 3); - Append("Z"); + // Doesn't allocate (unlike Time::ToISO8601String()) + char buffer[Time::ISO8601BufferSize]; + Append(std::string_view(buffer, Time::WriteISO8601(buffer, time))); } //--------------------------------------------------------------------------- diff --git a/ASWLog/ASWLog_Formatter.cpp b/ASWLog/ASWLog_Formatter.cpp index af97730..731fcb5 100644 --- a/ASWLog/ASWLog_Formatter.cpp +++ b/ASWLog/ASWLog_Formatter.cpp @@ -25,9 +25,12 @@ limitations under the License. #include "ASWLog_Formatter.h" //--------------------------------------------------------------------------- // System includes here +#include +#include #include #include #include +#include //--------------------------------------------------------------------------- #include "ASWLog_Utils.h" //--------------------------------------------------------------------------- @@ -35,6 +38,31 @@ limitations under the License. namespace ASWLog { +namespace +{ + +void AppendNumberField(std::string& line, std::string_view label, std::uint64_t value); + +//--------------------------------------------------------------------------- + +/* + AppendNumberField + + Appends "[