From 816aad0350d8e72816bb5011c9d4c446a76caee9 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 10 May 2023 12:56:19 -0700 Subject: [PATCH] Tweak debug logs in SocketModeClient (#1624) --- packages/socket-mode/src/SocketModeClient.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/socket-mode/src/SocketModeClient.ts b/packages/socket-mode/src/SocketModeClient.ts index cb4529e88..ede1d6d24 100644 --- a/packages/socket-mode/src/SocketModeClient.ts +++ b/packages/socket-mode/src/SocketModeClient.ts @@ -742,7 +742,9 @@ export class SocketModeClient extends EventEmitter { // Define Ack const ack = async (response: Record): Promise => { - this.logger.debug(`Calling ack() - type: ${event.type}, envelope_id: ${event.envelope_id}, data: ${response}`); + if (this.logger.getLevel() === LogLevel.DEBUG) { + this.logger.debug(`Calling ack() - type: ${event.type}, envelope_id: ${event.envelope_id}, data: ${JSON.stringify(response)}`); + } await this.send(event.envelope_id, response); };