Skip to content

Commit

Permalink
wrap byteFormat with debug for performance (denodrivers#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
laltin authored Feb 2, 2024
1 parent 37569ad commit 4373502
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/packets/packet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export class SendPacket {
data.writeUints(3, this.header.size);
data.write(this.header.no);
data.writeBuffer(body);
log.debug(`send: ${data.length}B \n${byteFormat(data.buffer)}\n`);
debug(() => {
log.debug(`send: ${data.length}B \n${byteFormat(data.buffer)}\n`);
});
try {
let wrote = 0;
do {
Expand Down

0 comments on commit 4373502

Please sign in to comment.