From 20a1492523ff2ecdae481002663258b2284382f9 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Tue, 21 Nov 2023 10:52:45 +0100 Subject: [PATCH] Avoid excessive trace logging (microsoft/vscode#197549) --- package.json | 2 +- src/index.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 09e041d..eda7aed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vscode/proxy-agent", - "version": "0.18.1", + "version": "0.18.2", "description": "NodeJS http(s) agent implementation for VS Code", "main": "out/index.js", "types": "out/index.d.ts", diff --git a/src/index.ts b/src/index.ts index 9cb2d9d..aec03fd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -676,6 +676,10 @@ export function toLogString(args: any[]) { if (t === 'bigint') { return String(value); } + if (t === 'string' && value.length > 25) { + const len = `[${value.length} chars]`; + return `${value.substr(0, 25 - len.length)}${len}`; + } return value; })).join(', ')}]`; }