https://github.com/da-viper updated https://github.com/llvm/llvm-project/pull/170737
>From facbbb7f129011d91f70404ce225e38d7fe0aeea Mon Sep 17 00:00:00 2001 From: Ebuka Ezike <[email protected]> Date: Thu, 4 Dec 2025 20:25:54 +0000 Subject: [PATCH 1/2] [lldb-dap] show a useful timestamp in log message --- lldb/tools/lldb-dap/DAPLog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lldb/tools/lldb-dap/DAPLog.cpp b/lldb/tools/lldb-dap/DAPLog.cpp index f66784e197518..5b1d650a87241 100644 --- a/lldb/tools/lldb-dap/DAPLog.cpp +++ b/lldb/tools/lldb-dap/DAPLog.cpp @@ -8,6 +8,7 @@ #include "DAPLog.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Support/Chrono.h" #include "llvm/Support/raw_ostream.h" #include <chrono> #include <mutex> @@ -20,10 +21,9 @@ namespace lldb_dap { Log::Log(StringRef filename, std::error_code &EC) : m_stream(filename, EC) {} void Log::WriteMessage(StringRef message) { - std::lock_guard<std::mutex> lock(m_mutex); - std::chrono::duration<double> now{ - std::chrono::system_clock::now().time_since_epoch()}; - m_stream << formatv("{0:f9} ", now.count()).str() << message << "\n"; + const std::lock_guard<std::mutex> lock(m_mutex); + const llvm::sys::TimePoint<> time = std::chrono::system_clock::now(); + m_stream << formatv("[{0:%H:%M:%S.%L}] ", time) << message << '\n'; m_stream.flush(); } >From 66ad92d197e81f713b1a306d8160ae04ee7018e9 Mon Sep 17 00:00:00 2001 From: Ebuka Ezike <[email protected]> Date: Fri, 5 Dec 2025 11:24:00 +0000 Subject: [PATCH 2/2] [lldb] add review changes --- lldb/tools/lldb-dap/DAPLog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/tools/lldb-dap/DAPLog.cpp b/lldb/tools/lldb-dap/DAPLog.cpp index 5b1d650a87241..34d26128efd3f 100644 --- a/lldb/tools/lldb-dap/DAPLog.cpp +++ b/lldb/tools/lldb-dap/DAPLog.cpp @@ -21,7 +21,7 @@ namespace lldb_dap { Log::Log(StringRef filename, std::error_code &EC) : m_stream(filename, EC) {} void Log::WriteMessage(StringRef message) { - const std::lock_guard<std::mutex> lock(m_mutex); + std::lock_guard<std::mutex> lock(m_mutex); const llvm::sys::TimePoint<> time = std::chrono::system_clock::now(); m_stream << formatv("[{0:%H:%M:%S.%L}] ", time) << message << '\n'; m_stream.flush(); _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
