From 6b5026dcf18aa0847ec5dcf960489ad72ca8abcb Mon Sep 17 00:00:00 2001 From: Adriano Cunha <35786489+adrcunha@users.noreply.github.com> Date: Fri, 26 Apr 2024 08:24:55 -0700 Subject: [PATCH] Drop newline in the activity indicator The "." character is printed on a new line every 2s to indicate that the discovery process is running. However, using a new line unnecessary floods the output log; switch to printing "." without a newline, keeping the activity indicator while also drastically reducing the number of lines in the output log. --- discovery.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discovery.ts b/discovery.ts index e3f02ca..3c5c1e4 100644 --- a/discovery.ts +++ b/discovery.ts @@ -34,7 +34,7 @@ export const discoverDevices = (debug: boolean, discovery_ip: string): EventEmit let buf = create_LanSearch(); setInterval(() => { - console.log("."); + process.stdout.write("."); sock.send(new Uint8Array(buf.buffer), SEND_PORT, discovery_ip); }, 2000); sock.send(new Uint8Array(buf.buffer), SEND_PORT, discovery_ip);