From 8836a0d780d8dc3f16d9721fdd7ee9a3ffc33855 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Fri, 22 Jun 2018 14:24:54 -0400 Subject: inspector: add debugging for WebSocket messages PR-URL: https://github.com/nodejs/node/pull/21473 Reviewed-By: Gus Caplan Reviewed-By: Eugene Ostroukhov Reviewed-By: James M Snell --- src/inspector_io.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/inspector_io.cc') diff --git a/src/inspector_io.cc b/src/inspector_io.cc index 01d78d177d..78ecce7398 100644 --- a/src/inspector_io.cc +++ b/src/inspector_io.cc @@ -314,6 +314,8 @@ void InspectorIo::SwapBehindLock(MessageQueue* vector1, void InspectorIo::PostIncomingMessage(InspectorAction action, int session_id, const std::string& message) { + Debug(parent_env_, DebugCategory::INSPECTOR_SERVER, + ">>> %s\n", message.c_str()); if (AppendMessage(&incoming_message_queue_, action, session_id, Utf8ToStringView(message))) { Agent* agent = main_thread_req_->second; @@ -395,6 +397,10 @@ void InspectorIo::MainThreadReqAsyncCb(uv_async_t* req) { void InspectorIo::Write(TransportAction action, int session_id, const StringView& inspector_message) { + std::string message_str = + protocol::StringUtil::StringViewToUtf8(inspector_message); + Debug(parent_env_, DebugCategory::INSPECTOR_SERVER, + "<<< %s\n", message_str.c_str()); AppendMessage(&outgoing_message_queue_, action, session_id, StringBuffer::create(inspector_message)); int err = uv_async_send(&thread_req_); -- cgit v1.2.3