[Lldb-commits] [lldb] [lldb-dap] Adding logging helpers. (PR #130653)
Adrian Vogelsgesang via lldb-commits
lldb-commits at lists.llvm.org
Tue Mar 11 04:47:00 PDT 2025
================
@@ -239,14 +241,7 @@ void DAP::SendJSON(const llvm::json::Value &json) {
std::lock_guard<std::mutex> locker(mutex);
SendJSON(json_str);
- if (log) {
- auto now = std::chrono::duration<double>(
- std::chrono::system_clock::now().time_since_epoch());
- *log << llvm::formatv("{0:f9} {1} <-- ", now.count(), name).str()
- << std::endl
- << "Content-Length: " << json_str.size() << "\r\n\r\n"
- << llvm::formatv("{0:2}", json).str() << std::endl;
- }
+ DAP_LOG(log, "({0}) <-- {1}", client_name, json_str);
----------------
vogelsgesang wrote:
```suggestion
DAP_LOG(log, "{0} <-- {1}", client_name, json_str);
```
For consistency with the log message in `ReadJSON` which also does not contain `()`. Or change the loggin in `ReadJSON`
https://github.com/llvm/llvm-project/pull/130653
More information about the lldb-commits
mailing list