https://github.com/da-viper created https://github.com/llvm/llvm-project/pull/170737
None >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] [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(); } _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
