Skip to content

Only show char codes for parsing data on trace#5425

Merged
Tyriar merged 4 commits intomasterfrom
anthonykim1/parsingDataCharCode
Oct 23, 2025
Merged

Only show char codes for parsing data on trace#5425
Tyriar merged 4 commits intomasterfrom
anthonykim1/parsingDataCharCode

Conversation

@anthonykim1
Copy link
Copy Markdown
Member

We previously did: #5420 to log character codes for sending data only on trace.
Should we do the same for parsing data?
Otherwise, the debug level for terminal output still is filled with bunch of character codes.

@anthonykim1 anthonykim1 requested a review from Tyriar October 22, 2025 16:49
@anthonykim1 anthonykim1 self-assigned this Oct 22, 2025
this._logService.debug(`parsing data ${typeof data === 'string' ? ` "${data}"` : ` "${Array.prototype.map.call(data, e => String.fromCharCode(e)).join('')}"`}`);
this._logService.trace(`parsing data (codes)`, () => typeof data === 'string'
? data.split('').map(e => e.charCodeAt(0))
: Array.from(data)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't need Array.from before?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Facts!! You're right.. data is Uint8Array, doing Array.from(data) feels like complete waste.
When we use logService to print, it would look identical, right?
I dont think I ever saw Uint8Array(5) that prepends these characters in the log

@Tyriar Tyriar added this to the 6.0.0 milestone Oct 22, 2025
@anthonykim1 anthonykim1 marked this pull request as draft October 22, 2025 22:47
@anthonykim1 anthonykim1 marked this pull request as ready for review October 22, 2025 23:33
@anthonykim1 anthonykim1 requested a review from Tyriar October 22, 2025 23:33
@Tyriar Tyriar enabled auto-merge October 23, 2025 02:02
@Tyriar Tyriar merged commit 9fce067 into master Oct 23, 2025
12 checks passed
@Tyriar Tyriar deleted the anthonykim1/parsingDataCharCode branch October 23, 2025 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants