From 9a3ee4916063dd3712db5e51a7aeba980897c93b Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 22 Dec 2021 09:58:15 -0800 Subject: [PATCH] Log characters as a code array when parsing data as well Makes it consistent with sending data debug logs Fixes #3505 --- src/common/InputHandler.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/InputHandler.ts b/src/common/InputHandler.ts index 1ce3c836..2b4fdd7b 100644 --- a/src/common/InputHandler.ts +++ b/src/common/InputHandler.ts @@ -544,7 +544,13 @@ export class InputHandler extends Disposable implements IInputHandler { } } - this._logService.debug('parsing data', data); + // Log debug data, the log level gate is to prevent extra work in this hot path + if (this._logService.logLevel <= LogLevelEnum.DEBUG) { + this._logService.debug(`parsing data${typeof data === 'string' ? ` "${data}"` : ''}`, typeof data === 'string' + ? data.split('').map(e => e.charCodeAt(0)) + : data + ); + } // resize input buffer if needed if (this._parseBuffer.length < data.length) {