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:
parent
8541408504
commit
c722e18496
1 changed files with 5 additions and 1 deletions
|
|
@ -198,7 +198,11 @@ export class ViceClient {
|
||||||
const body = this.responseBuffer.subarray(12, totalLength);
|
const body = this.responseBuffer.subarray(12, totalLength);
|
||||||
|
|
||||||
debugLog(`Parsed response: type=0x${responseType.toString(16)}, error=0x${errorCode.toString(16)}, reqId=${requestId}`);
|
debugLog(`Parsed response: type=0x${responseType.toString(16)}, error=0x${errorCode.toString(16)}, reqId=${requestId}`);
|
||||||
debugLog("Response body", body);
|
if (body.length < 1000) {
|
||||||
|
debugLog("Response body", body);
|
||||||
|
} else {
|
||||||
|
debugLog(`Response body: ${body.length} bytes (too large to log)`);
|
||||||
|
}
|
||||||
|
|
||||||
const response: ViceResponse = {
|
const response: ViceResponse = {
|
||||||
responseType,
|
responseType,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue