GeezerVison is showing github.com — inspector: log response and requests in the inspector for debugging · nodejs/node@e33dfce
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/inspector_agent.cc +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -248,6 +248,9 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel, |
248 | 248 |
|
249 | 249 | void dispatchProtocolMessage(const StringView& message) { |
250 | 250 | std::string raw_message = protocol::StringUtil::StringViewToUtf8(message); |
| 251 | + per_process::Debug(DebugCategory::INSPECTOR_SERVER, |
| 252 | + "[inspector received] %s\n", |
| 253 | + raw_message); |
251 | 254 | std::unique_ptr<protocol::DictionaryValue> value = |
252 | 255 | protocol::DictionaryValue::cast(protocol::StringUtil::parseMessage( |
253 | 256 | raw_message, false)); |
@@ -296,6 +299,13 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel, |
296 | 299 | void flushProtocolNotifications() override { } |
297 | 300 |
|
298 | 301 | void sendMessageToFrontend(const StringView& message) { |
| 302 | + if (per_process::enabled_debug_list.enabled( |
| 303 | + DebugCategory::INSPECTOR_SERVER)) { |
| 304 | + std::string raw_message = protocol::StringUtil::StringViewToUtf8(message); |
| 305 | + per_process::Debug(DebugCategory::INSPECTOR_SERVER, |
| 306 | + "[inspector send] %s\n", |
| 307 | + raw_message); |
| 308 | + } |
299 | 309 | delegate_->SendMessageToFrontend(message); |
300 | 310 | } |
301 | 311 |
|
|