Skip to content

Commit

Permalink
Clean up logging
Browse files Browse the repository at this point in the history
Fixes #212
  • Loading branch information
neilenns committed Jul 31, 2024
1 parent 0243716 commit 8469c9a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/eventHandlers/trackAudio/rxBegin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ import { RxBegin } from "@interfaces/messages";
import actionManager from "@managers/action";

export const handleRxBegin = (data: RxBegin) => {
console.log(`Receive started on: ${data.value.pFrequencyHz.toString()}`);
actionManager.rxBegin(data.value.pFrequencyHz, data.value.callsign);
};
1 change: 0 additions & 1 deletion src/eventHandlers/trackAudio/rxEnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ import { RxEnd } from "@interfaces/messages";
import actionManager from "@managers/action";

export const handleRxEnd = (data: RxEnd) => {
console.log(`Receive started on: ${data.value.pFrequencyHz.toString()}`);
actionManager.rxEnd(data.value.pFrequencyHz);
};
8 changes: 4 additions & 4 deletions src/managers/trackAudio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ class TrackAudioManager extends EventEmitter {
this.socket = new WebSocket(this.url);

this.socket.on("open", () => {
console.log("WebSocket connection established.");
console.debug("WebSocket connection established.");
this.emit("connected");
});

this.socket.on("close", () => {
console.log("WebSocket connection closed");
console.debug("WebSocket connection closed");

this._isVoiceConnected = false;
this.emit("disconnected");
Expand Down Expand Up @@ -122,7 +122,7 @@ class TrackAudioManager extends EventEmitter {
* @param message The message to process
*/
private processMessage(message: string): void {
console.log("received: %s", message);
console.debug("Received: %s", message);

const data = JSON.parse(message) as IncomingMessage;

Expand Down Expand Up @@ -193,7 +193,7 @@ class TrackAudioManager extends EventEmitter {
}

this.reconnectTimer = setTimeout(() => {
console.log(`Attempting to reconnect...`);
console.debug(`Attempting to reconnect...`);
this.connect();
}, this.reconnectInterval);
}
Expand Down

0 comments on commit 8469c9a

Please sign in to comment.