From a24001eb3d0735ed7de76c159375df5b9302df87 Mon Sep 17 00:00:00 2001 From: Taylor Downs Date: Thu, 9 Jul 2020 16:14:22 -0600 Subject: [PATCH] cleaner logs, hide response body for sensitive data --- lib/Client.js | 6 ++---- package.json | 2 +- src/Client.js | 14 ++++++-------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/Client.js b/lib/Client.js index a686957..e7700d9 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -27,8 +27,7 @@ function rawRequest(params) { params: params }); error && reject(error); - console.log("\u2713 Request succeeded."); - console.log("Server responded with: \n".concat(JSON.stringify(response, null, 2))); + console.log("\u2713 Request succeeded. (The response body will be available in state.)"); var resp = (0, _Utils.tryJson)(body); resolve(resp); }); @@ -67,8 +66,7 @@ function req(method, params) { if (error) { reject(error); } else { - console.log("\u2713 ".concat(method, " succeeded.")); - console.log("Server responded with: \n".concat(JSON.stringify(response, null, 2))); + console.log("\u2713 ".concat(method, " succeeded. (The response body will be available in state.)")); var resp = (0, _Utils.tryJson)(body); if (rest.keepCookie) { diff --git a/package.json b/package.json index 5c51824..7e6cd82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "language-http", - "version": "2.4.8", + "version": "2.4.9", "description": "An HTTP request language package for use with Open Function", "main": "lib/index.js", "scripts": { diff --git a/src/Client.js b/src/Client.js index 4b0b48a..6d07594 100644 --- a/src/Client.js +++ b/src/Client.js @@ -7,10 +7,9 @@ export function rawRequest(params) { error = assembleError({ error, response, params }); error && reject(error); - console.log(`✓ Request succeeded.`); - // console.log( - // `Server responded with: \n${JSON.stringify(response, null, 2)}` - // ); + console.log( + `✓ Request succeeded. (The response body will be available in state.)` + ); const resp = tryJson(body); resolve(resp); }); @@ -39,10 +38,9 @@ export function req(method, params) { if (error) { reject(error); } else { - console.log(`✓ ${method} succeeded.`); - // console.log( - // `Server responded with: \n${JSON.stringify(response, null, 2)}` - // ); + console.log( + `✓ ${method} succeeded. (The response body will be available in state.)` + ); const resp = tryJson(body); if (rest.keepCookie) { const __cookie = j.getCookieString(url);