Skip to content

Commit 574a47f

Browse files
committed
Debug log
1 parent 80ce43b commit 574a47f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/socket/ws.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const WebSocket = require("ws");
55
const cds = require("@sap/cds");
66

77
const LOG = cds.log("websocket/ws");
8+
const DEBUG = cds.debug("websocket");
89

910
class SocketWSServer extends SocketServer {
1011
constructor(server, path) {
@@ -39,6 +40,10 @@ class SocketWSServer extends SocketServer {
3940
if (ws.request?.url !== `${this.path}${service}`) {
4041
return;
4142
}
43+
DEBUG?.("Connected");
44+
ws.on("close", () => {
45+
DEBUG?.("Disconnected");
46+
});
4247
ws.on("error", (error) => {
4348
LOG?.error(error);
4449
});

0 commit comments

Comments
 (0)