From 5104ce87eef3a3c87a694f26a565a0072f5733bb Mon Sep 17 00:00:00 2001 From: Luk Date: Mon, 5 Feb 2024 09:52:18 +0800 Subject: [PATCH] console.log({_at, ...}) --- messenger.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/messenger.js b/messenger.js index d533f93..91a8736 100644 --- a/messenger.js +++ b/messenger.js @@ -31,14 +31,14 @@ module.exports = { } */ if (result.messageId && result.response === '250 Ok') { - console.log('MSG_SENT_SUCCESS', result) + console.log({ _at: new Date().toJSON(), _state: 'MSG_SENT_SUCCESS', ...result }) return { _state: 'MSG_SENT_SUCCESS' } } - console.log('MSG_SEND_FAIL', result) + console.log({ _at: new Date().toJSON(), _state: 'MSG_SEND_FAIL', ...result }) return { _state: 'MSG_SEND_FAIL' } }) - .catch((err) => { - console.log('SMS_SEND_ERROR', err) + .catch((error) => { + console.log({ _at: new Date().toJSON(), _state: 'SMS_SEND_ERROR', error }) return { _state: 'SMS_SEND_ERROR' } }) },