From 16d4d2563c1cad4beb7a07b52c16eeb906572fe4 Mon Sep 17 00:00:00 2001 From: Mike Talley Date: Thu, 14 Jan 2021 17:48:37 -0500 Subject: [PATCH 1/2] removed output of log.payload as it is not included in the response anymore --- packages/cli-lib/lib/logs.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/cli-lib/lib/logs.js b/packages/cli-lib/lib/logs.js index 24bcf249e..4b40df0c0 100644 --- a/packages/cli-lib/lib/logs.js +++ b/packages/cli-lib/lib/logs.js @@ -1,4 +1,3 @@ -const util = require('util'); const moment = require('moment'); const chalk = require('chalk'); const { logger, Styles } = require('../logger'); @@ -24,14 +23,10 @@ const logHandler = { return `${formatLogHeader(log)}${compact ? '' : formatError(log)}`; }, SUCCESS: (log, { compact }) => { - return `${formatLogHeader(log)}${compact ? '' : formatLogPayloadData(log)}`; + return `${formatLogHeader(log)}${compact ? '' : `\n${formatLog(log)}`}`; }, }; -const formatLogPayloadData = log => { - return `\n${formatPayload(log)}\n${formatLog(log)}`; -}; - const formatLogHeader = log => { const color = LOG_STATUS_COLORS[log.status]; @@ -57,14 +52,6 @@ const formatTimestamp = log => { return `${chalk.whiteBright(moment(log.createdAt).toISOString())}`; }; -const formatPayload = log => { - return util.inspect(log.payload, { - colors: true, - compact: true, - depth: 'Infinity', - }); -}; - const formatExecutionTime = log => { return `${chalk.whiteBright('Execution Time:')} ${log.executionTime}ms`; }; From 19f2dd7a3ed5843acbcd30faef2d9f655db05db4 Mon Sep 17 00:00:00 2001 From: Mike Talley Date: Thu, 14 Jan 2021 17:48:59 -0500 Subject: [PATCH 2/2] improved output of error logs --- packages/cli-lib/lib/logs.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/cli-lib/lib/logs.js b/packages/cli-lib/lib/logs.js index 4b40df0c0..634cbe3ee 100644 --- a/packages/cli-lib/lib/logs.js +++ b/packages/cli-lib/lib/logs.js @@ -10,17 +10,15 @@ const LOG_STATUS_COLORS = { }; const formatError = log => { - return `/n${log.error.type}: ${log.error.message}\n${formatStackTrace( - log - )}\n`; + return `${log.error.type}: ${log.error.message}\n${formatStackTrace(log)}`; }; const logHandler = { UNHANDLED_ERROR: (log, { compact }) => { - return `${formatLogHeader(log)}${compact ? '' : formatError(log)}`; + return `${formatLogHeader(log)}${compact ? '' : `\n${formatError(log)}`}`; }, HANDLED_ERROR: (log, { compact }) => { - return `${formatLogHeader(log)}${compact ? '' : formatError(log)}`; + return `${formatLogHeader(log)}${compact ? '' : `\n${formatError(log)}`}`; }, SUCCESS: (log, { compact }) => { return `${formatLogHeader(log)}${compact ? '' : `\n${formatLog(log)}`}`;