Skip to content

Commit

Permalink
fix: format received buffers as hex in debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Dec 14, 2019
1 parent d884eb1 commit 611d12c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/atemSocketChild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export class AtemSocketChild {
}

private _receivePacket (packet: Buffer, rinfo: RemoteInfo) {
if (this._debug) this.log(`RECV ${packet}`)
if (this._debug) this.log(`RECV ${packet.toString('hex')}`)
this._lastReceivedAt = Date.now()
const length = packet.readUInt16BE(0) & 0x07ff
if (length !== rinfo.size) return
Expand Down Expand Up @@ -277,7 +277,7 @@ export class AtemSocketChild {
}

private _sendPacket (packet: Buffer) {
if (this._debug) this.log(`SEND ${packet}`)
if (this._debug) this.log(`SEND ${packet.toString('hex')}`)
this._socket.send(packet, 0, packet.length, this._port, this._address)
}

Expand Down

0 comments on commit 611d12c

Please sign in to comment.