Skip to content

Commit

Permalink
added support for trimming long arguments from verbose logs for execu…
Browse files Browse the repository at this point in the history
…te() commands
  • Loading branch information
beatfactor committed Dec 28, 2022
1 parent 4d5791f commit a4ea22f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/http/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ class HttpRequest extends EventEmitter {
// Trim long execute script strings from params
if (this.reqOptions.path.includes('/execute/') && params.script) {
params.script = params.script.substring(0, 200) + `... (${params.script.length} characters)`;
params.args = params.args.map(arg => {
if (isString(arg) && arg.length > 200) {
return arg.substring(0, 200) + `... (${arg.length} characters)`;
}

return arg;
});
}

const content = ` Request ${Logger.colors.light_cyan([this.reqOptions.method, this.hostname + this.reqOptions.path, retryStr + ' '].join(' '))}`;
Expand Down

0 comments on commit a4ea22f

Please sign in to comment.