Skip to content

Commit 318f734

Browse files
authored
Shubhra/log room event with env var (#536)
* init * changeset * lint fix
1 parent 824da80 commit 318f734

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.changeset/pretty-grapes-smell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@livekit/rtc-node': patch
3+
---
4+
5+
add an environment varaible to log all room events

packages/livekit-rtc/src/room.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ export class Room extends (EventEmitter as new () => TypedEmitter<RoomCallbacks>
321321
}
322322

323323
const ev = ffiEvent.message.value.message;
324+
if (process.env.LIVEKIT_DEBUG_LOG_ROOM_EVENTS) {
325+
console.log('Room event:', ev);
326+
}
324327
if (ev.case == 'participantConnected') {
325328
const participant = this.createRemoteParticipant(ev.value.info!);
326329
this.remoteParticipants.set(participant.identity!, participant);

turbo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://turborepo.org/schema.json",
3-
"globalEnv": ["LIVEKIT_URL", "LIVEKIT_API_KEY", "LIVEKIT_API_SECRET", "NODE_ENV"],
3+
"globalEnv": ["LIVEKIT_URL", "LIVEKIT_API_KEY", "LIVEKIT_API_SECRET", "NODE_ENV", "LIVEKIT_DEBUG_LOG_ROOM_EVENTS"],
44
"tasks": {
55
"build": {
66
"dependsOn": ["^build"],

0 commit comments

Comments
 (0)