summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-12 21:54:58 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-12 21:54:58 +0200
commit90c5444324d0ff1c1af7f4bd9f16997cee4df0b5 (patch)
treeb26e2522ca3099166a552674874d5726896d8de2
parent:zap: improve memory managment (diff)
downloadserver-90c5444324d0ff1c1af7f4bd9f16997cee4df0b5.tar.xz
:pencil: improve logging
-rw-r--r--gateway/src/Server.ts1
-rw-r--r--gateway/src/events/Connection.ts1
-rw-r--r--gateway/src/events/Message.ts2
-rw-r--r--gateway/src/opcodes/Identify.ts2
4 files changed, 1 insertions, 5 deletions
diff --git a/gateway/src/Server.ts b/gateway/src/Server.ts
index cf4f906c..7e1489be 100644
--- a/gateway/src/Server.ts
+++ b/gateway/src/Server.ts
@@ -32,7 +32,6 @@ export class Server {
 		}
 
 		this.server.on("upgrade", (request, socket, head) => {
-			console.log("socket requests upgrade", request.url);
 			// @ts-ignore
 			this.ws.handleUpgrade(request, socket, head, (socket) => {
 				this.ws.emit("connection", socket, request);
diff --git a/gateway/src/events/Connection.ts b/gateway/src/events/Connection.ts
index 2cf22f7d..9bb034f0 100644
--- a/gateway/src/events/Connection.ts
+++ b/gateway/src/events/Connection.ts
@@ -28,6 +28,7 @@ export async function Connection(
 		socket.on("close", Close);
 		// @ts-ignore
 		socket.on("message", Message);
+		console.log(`[Gateway] Connections: ${this.clients.size}`);
 
 		const { searchParams } = new URL(`http://localhost${request.url}`);
 		// @ts-ignore
diff --git a/gateway/src/events/Message.ts b/gateway/src/events/Message.ts
index af318bfd..acc39bb9 100644
--- a/gateway/src/events/Message.ts
+++ b/gateway/src/events/Message.ts
@@ -37,8 +37,6 @@ export async function Message(this: WebSocket, buffer: WS.Data) {
 		return;
 	}
 
-	console.log("[Gateway] Opcode " + OPCODES[data.op]);
-
 	try {
 		return await OPCodeHandler.call(this, data);
 	} catch (error) {
diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts
index 673dde9d..c91ca5dd 100644
--- a/gateway/src/opcodes/Identify.ts
+++ b/gateway/src/opcodes/Identify.ts
@@ -214,8 +214,6 @@ export async function onIdentify(this: WebSocket, data: Payload) {
 		// application // TODO for applications
 	};
 
-	console.log("Send ready");
-
 	// TODO: send real proper data structure
 	await Send(this, {
 		op: OPCODES.Dispatch,