Skip debug logging for large response bodies (>1KB)

DisplayGet returns ~150KB of pixel data which was being logged to stderr,
potentially causing crashes. Now shows just the size for large responses.

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Simen Svale 2025-12-30 04:14:50 +01:00
parent 8541408504
commit c722e18496

View file

@ -198,7 +198,11 @@ export class ViceClient {
const body = this.responseBuffer.subarray(12, totalLength);
debugLog(`Parsed response: type=0x${responseType.toString(16)}, error=0x${errorCode.toString(16)}, reqId=${requestId}`);
if (body.length < 1000) {
debugLog("Response body", body);
} else {
debugLog(`Response body: ${body.length} bytes (too large to log)`);
}
const response: ViceResponse = {
responseType,