From 98c9af4acfb769925a28811875a8513723ed19af Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Tue, 12 Apr 2022 16:51:15 +0530 Subject: [PATCH] feat: log fromMe messages in trace mode --- src/Socket/socket.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Socket/socket.ts b/src/Socket/socket.ts index aecb686..edac1ed 100644 --- a/src/Socket/socket.ts +++ b/src/Socket/socket.ts @@ -83,8 +83,12 @@ export const makeSocket = ({ } /** send a binary node */ - const sendNode = (node: BinaryNode) => { - const buff = encodeBinaryNode(node) + const sendNode = (frame: BinaryNode) => { + if(logger.level === 'trace') { + logger.trace({ msgId: frame.attrs.id, fromMe: true, frame }, 'communication') + } + + const buff = encodeBinaryNode(frame) return sendRawMessage(buff) }