From 9c878eab80f7e78be80374d35f8e0dc7bb1ce101 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 21 Sep 2023 16:50:31 +0100 Subject: [PATCH 1/2] Capture livekit's logs in rageshakes --- src/livekit/useLiveKit.ts | 2 -- src/main.tsx | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/livekit/useLiveKit.ts b/src/livekit/useLiveKit.ts index fe1bec20..9949a69b 100644 --- a/src/livekit/useLiveKit.ts +++ b/src/livekit/useLiveKit.ts @@ -44,8 +44,6 @@ export type E2EEConfig = { sharedKey: string; }; -setLogLevel("debug"); - interface UseLivekitResult { livekitRoom?: Room; connState: ECConnectionState; diff --git a/src/main.tsx b/src/main.tsx index d04a3a94..0ec2bfae 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -23,13 +23,19 @@ import "matrix-js-sdk/src/browser-index"; import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; import { createBrowserHistory } from "history"; - import "./index.css"; +import { setLogLevel as setLKLogLevel } from "livekit-client"; + import App from "./App"; import { init as initRageshake } from "./settings/rageshake"; import { Initializer } from "./initializer"; initRageshake(); +// set livekit's log level: we do this after initialising rageshakes because +// we need rageshake to do its monkey patching first, so the livekit +// logger gets the patched log funxction, so it picks up livekit's +// logs. +setLKLogLevel("debug"); console.info(`Element Call ${import.meta.env.VITE_APP_VERSION || "dev"}`); From 9bf0dc7deec8b12af2093dda6732154af53835f1 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 21 Sep 2023 16:58:02 +0100 Subject: [PATCH 2/2] Unused import --- src/livekit/useLiveKit.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/livekit/useLiveKit.ts b/src/livekit/useLiveKit.ts index 9949a69b..d6d8394b 100644 --- a/src/livekit/useLiveKit.ts +++ b/src/livekit/useLiveKit.ts @@ -20,7 +20,6 @@ import { ExternalE2EEKeyProvider, Room, RoomOptions, - setLogLevel, } from "livekit-client"; import { useLiveKitRoom } from "@livekit/components-react"; import { useEffect, useMemo, useRef, useState } from "react";