From 59aa384ec6b1a130c360deddef7cbc475d545fca Mon Sep 17 00:00:00 2001 From: Moon Man Date: Sun, 28 Jan 2024 12:19:00 -0500 Subject: [PATCH] more logging --- dist/bert.js | 2 +- dist/main.js | 2 +- src/bert.ts | 2 +- src/main.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/bert.js b/dist/bert.js index 57c802a..19305cf 100644 --- a/dist/bert.js +++ b/dist/bert.js @@ -335,7 +335,7 @@ export class Bert { }; }; decode_string = (buffer) => { - const sizeLen = this.convention == Lang.ELIXIR ? 4 : 2; + const sizeLen = this.convention === Lang.ELIXIR ? 4 : 2; const size = this.bytesToInt(buffer, sizeLen, true); buffer = buffer.subarray(sizeLen); return { diff --git a/dist/main.js b/dist/main.js index 7c1d304..b28a19b 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}\n`); + process.stderr.write(`Got incoming term length: ${termLen} (bytes: ${lenBytes})\n`); const termBytes = process.stdin.read(termLen); if (termBytes) { const decoded = this.bert.decode(termBytes); diff --git a/src/bert.ts b/src/bert.ts index dfcb284..7d0b61b 100644 --- a/src/bert.ts +++ b/src/bert.ts @@ -391,7 +391,7 @@ export class Bert { }; decode_string = (buffer: Buffer) => { - const sizeLen = this.convention == Lang.ELIXIR ? 4 : 2; + const sizeLen = this.convention === Lang.ELIXIR ? 4 : 2; const size = this.bytesToInt(buffer, sizeLen, true); buffer = buffer.subarray(sizeLen); diff --git a/src/main.ts b/src/main.ts index 0a43e32..29a825e 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}\n`); + process.stderr.write(`Got incoming term length: ${termLen} (bytes: ${lenBytes})\n`); const termBytes = process.stdin.read(termLen); if (termBytes) {