Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e33dfce

Browse filesBrowse files
joyeecheungRafaelGSS
authored andcommitted
inspector: log response and requests in the inspector for debugging
Logs the raw messages from the inspector when NODE_DEBUG_NATIVE is set to inspector_server to facilitate debugging. PR-URL: #46941 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent 77f7200 commit e33dfce
Copy full SHA for e33dfce

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Collapse file

‎src/inspector_agent.cc‎

Copy file name to clipboardExpand all lines: src/inspector_agent.cc
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
248248

249249
void dispatchProtocolMessage(const StringView& message) {
250250
std::string raw_message = protocol::StringUtil::StringViewToUtf8(message);
251+
per_process::Debug(DebugCategory::INSPECTOR_SERVER,
252+
"[inspector received] %s\n",
253+
raw_message);
251254
std::unique_ptr<protocol::DictionaryValue> value =
252255
protocol::DictionaryValue::cast(protocol::StringUtil::parseMessage(
253256
raw_message, false));
@@ -296,6 +299,13 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
296299
void flushProtocolNotifications() override { }
297300

298301
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+
}
299309
delegate_->SendMessageToFrontend(message);
300310
}
301311

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.