[Lldb-commits] [lldb] [lldb-dap] Updating the logging of lldb-dap to use existing LLDBLog. (PR #129294)

Adrian Vogelsgesang via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 28 19:25:54 PST 2025


================
@@ -314,12 +308,7 @@ serveConnection(const Socket::SocketProtocol &protocol, const std::string &name,
                                           &clientCount](
                                              std::unique_ptr<Socket> sock) {
     std::string name = llvm::formatv("client_{0}", clientCount++).str();
-    if (log) {
-      auto now = std::chrono::duration<double>(
-          std::chrono::system_clock::now().time_since_epoch());
-      *log << llvm::formatv("{0:f9}", now.count()).str()
-           << " client connected: " << name << "\n";
-    }
+    LLDB_LOG(GetLog(DAPLog::Connection), "client ({0}) connected", name);
----------------
vogelsgesang wrote:

Given that the name itself already reads `client_12`, I think we should rather write "client_12 connected" than "client (client_12) connected". WDYT? In case you agree, you probably also want to fix the other log line re disconnecting

```suggestion
    LLDB_LOG(GetLog(DAPLog::Connection), "{0} connected", name);
```

https://github.com/llvm/llvm-project/pull/129294


More information about the lldb-commits mailing list