Author: Ebuka Ezike Date: 2025-12-05T12:49:34Z New Revision: f827e4d1cf659da350f49911dcee2ac5f88ae5a2
URL: https://github.com/llvm/llvm-project/commit/f827e4d1cf659da350f49911dcee2ac5f88ae5a2 DIFF: https://github.com/llvm/llvm-project/commit/f827e4d1cf659da350f49911dcee2ac5f88ae5a2.diff LOG: [lldb-dap] show a useful timestamp in log messages (#170737) It becomes easier to see the time difference between requests and responses Added: Modified: lldb/tools/lldb-dap/DAPLog.cpp Removed: ################################################################################ diff --git a/lldb/tools/lldb-dap/DAPLog.cpp b/lldb/tools/lldb-dap/DAPLog.cpp index f66784e197518..34d26128efd3f 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> @@ -21,9 +22,8 @@ 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 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
