From e8efe9c26d4c7c9f83fff830adf57eda9284551d Mon Sep 17 00:00:00 2001 From: shmyga Date: Tue, 12 May 2026 16:41:55 +0300 Subject: [PATCH] feat(connection): packet json logging --- src/main/hw/connect/BaseConnection.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/hw/connect/BaseConnection.hx b/src/main/hw/connect/BaseConnection.hx index 3c5d13d..6507f42 100755 --- a/src/main/hw/connect/BaseConnection.hx +++ b/src/main/hw/connect/BaseConnection.hx @@ -7,6 +7,8 @@ import promhx.Deferred; import promhx.Promise; import protohx.Message; +using protohx.MessageUtils; + class BaseConnection implements IConnection { public var handler(default, null):Signal; public var sendHandler(default, null):Signal; @@ -41,12 +43,12 @@ class BaseConnection implements IConnection { } public function send(packet:O):Void { - #if proto_debug L.d('Proto', 'send: ${packet}'); #end + #if proto_debug L.d('Proto', 'send: ${packet.toJson()}'); #end sendHandler.emit(packet); } public function receive(packet:I):Void { - #if proto_debug L.d('Proto', 'receive: ${packet}'); #end + #if proto_debug L.d('Proto', 'receive: ${packet.toJson()}'); #end receiveHandler.emit(packet); } }