diff --git a/lib/jsonwp-proxy/proxy.js b/lib/jsonwp-proxy/proxy.js index 2f67030d0..b0ff93f59 100644 --- a/lib/jsonwp-proxy/proxy.js +++ b/lib/jsonwp-proxy/proxy.js @@ -1,3 +1,4 @@ +// jshint ignore: start import _ from 'lodash'; import { getLogger } from 'appium-logger'; import { util } from 'appium-support'; @@ -108,12 +109,12 @@ class JWProxy { } log.info(`Proxying [${method} ${url || "/"}] to [${method} ${newUrl}] ` + - (body ? `with body: ${_.truncate(JSON.stringify(body), LOG_LENGTH)}` : 'with no body')); + (body ? `with body: ${_.truncate(JSON.stringify(body), {length: LOG_LENGTH})}` : 'with no body')); let res, resBody; try { res = await this.request(reqOpts); resBody = res.body; - log.info(`Got response with status ${res.statusCode}: ${_.truncate(JSON.stringify(resBody), LOG_LENGTH)}`); + log.info(`Got response with status ${res.statusCode}: ${_.truncate(JSON.stringify(resBody), {length: LOG_LENGTH})}`); if (/\/session$/.test(url) && method === 'POST') { if (res.statusCode === 200) { this.sessionId = resBody.sessionId;