From f2baff28163c73688b90e10853fd02c377e6010c Mon Sep 17 00:00:00 2001 From: Moon Man Date: Sun, 28 Jan 2024 12:35:02 -0500 Subject: [PATCH] logging --- dist/main.js | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/main.js b/dist/main.js index 8c16743..79cb43c 100644 --- a/dist/main.js +++ b/dist/main.js @@ -17,7 +17,7 @@ export class Port extends Duplex { const lenBytes = process.stdin.read(4); if (lenBytes) { const termLen = this.bert.bytesToInt(lenBytes, 4, true); - process.stderr.write(`Got incoming term length: ${termLen} (bytes: ${lenBytes.toString('hex').match(/../g).join(' ')})\n`); + process.stderr.write(`Got incoming term length: ${termLen} (bytes: <<${lenBytes.toString('hex').match(/../g).map((hex) => parseInt(`0x${hex}`).toString()).join(', ')}>>)\n`); const termBytes = process.stdin.read(termLen); if (termBytes) { const decoded = this.bert.decode(termBytes); diff --git a/src/main.ts b/src/main.ts index 29c602c..8ba8e4e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -22,7 +22,7 @@ export class Port extends Duplex { const lenBytes = process.stdin.read(4); if (lenBytes) { const termLen = this.bert.bytesToInt(lenBytes, 4, true); - process.stderr.write(`Got incoming term length: ${termLen} (bytes: ${lenBytes.toString('hex').match(/../g).join(' ')})\n`); + process.stderr.write(`Got incoming term length: ${termLen} (bytes: <<${lenBytes.toString('hex').match(/../g).map((hex: string) => parseInt(`0x${hex}`).toString()).join(', ')}>>)\n`); const termBytes = process.stdin.read(termLen); if (termBytes) {