mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-05 19:59:20 +00:00
dev-tool: Add option to enable extended livekit logs
This commit is contained in:
@@ -32,6 +32,7 @@ import { type AppViewModel } from "./state/AppViewModel";
|
|||||||
import { MediaDevicesContext } from "./MediaDevicesContext";
|
import { MediaDevicesContext } from "./MediaDevicesContext";
|
||||||
import { getUrlParams, HeaderStyle } from "./UrlParams";
|
import { getUrlParams, HeaderStyle } from "./UrlParams";
|
||||||
import { AppBar } from "./AppBar";
|
import { AppBar } from "./AppBar";
|
||||||
|
import { LivekitLogLevelSync } from "./LivekitLogLevelSync.tsx";
|
||||||
|
|
||||||
const SentryRoute = Sentry.withSentryReactRouterV7Routing(Route);
|
const SentryRoute = Sentry.withSentryReactRouterV7Routing(Route);
|
||||||
|
|
||||||
@@ -81,6 +82,7 @@ export const App: FC<Props> = ({ vm }) => {
|
|||||||
const content = loaded ? (
|
const content = loaded ? (
|
||||||
<ClientProvider>
|
<ClientProvider>
|
||||||
<MediaDevicesContext value={vm.mediaDevices}>
|
<MediaDevicesContext value={vm.mediaDevices}>
|
||||||
|
<LivekitLogLevelSync />
|
||||||
<ProcessorProvider>
|
<ProcessorProvider>
|
||||||
<Sentry.ErrorBoundary
|
<Sentry.ErrorBoundary
|
||||||
fallback={(error) => <ErrorPage error={error} widget={widget} />}
|
fallback={(error) => <ErrorPage error={error} widget={widget} />}
|
||||||
|
|||||||
22
src/LivekitLogLevelSync.tsx
Normal file
22
src/LivekitLogLevelSync.tsx
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2026 Element Creations Ltd.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||||
|
Please see LICENSE in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Syncs the livekit log level with the "Enable extended Livekit logs" developer setting.
|
||||||
|
import { type FC, useEffect } from "react";
|
||||||
|
import { setLogLevel } from "livekit-client";
|
||||||
|
|
||||||
|
import { useSetting, enableExtendedLivekitLogs } from "./settings/settings.ts";
|
||||||
|
|
||||||
|
export const LivekitLogLevelSync: FC = () => {
|
||||||
|
const [extendedLivekitLogs] = useSetting(enableExtendedLivekitLogs);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setLogLevel(extendedLivekitLogs ? "trace" : "info");
|
||||||
|
}, [extendedLivekitLogs]);
|
||||||
|
|
||||||
|
return <></>;
|
||||||
|
};
|
||||||
@@ -43,6 +43,7 @@ import {
|
|||||||
matrixRTCMode as matrixRTCModeSetting,
|
matrixRTCMode as matrixRTCModeSetting,
|
||||||
customLivekitUrl as customLivekitUrlSetting,
|
customLivekitUrl as customLivekitUrlSetting,
|
||||||
MatrixRTCMode,
|
MatrixRTCMode,
|
||||||
|
enableExtendedLivekitLogs as enableExtendedLivekitLogsSetting,
|
||||||
} from "./settings";
|
} from "./settings";
|
||||||
import styles from "./DeveloperSettingsTab.module.css";
|
import styles from "./DeveloperSettingsTab.module.css";
|
||||||
import { useUrlParams } from "../UrlParams";
|
import { useUrlParams } from "../UrlParams";
|
||||||
@@ -101,6 +102,10 @@ export const DeveloperSettingsTab: FC<Props> = ({
|
|||||||
alwaysShowIphoneEarpieceSetting,
|
alwaysShowIphoneEarpieceSetting,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const [enableExtendedLivekitLogs, setEnableExtendedLivekitLogs] = useSetting(
|
||||||
|
enableExtendedLivekitLogsSetting,
|
||||||
|
);
|
||||||
|
|
||||||
const [customLivekitUrlUpdateError, setCustomLivekitUrlUpdateError] =
|
const [customLivekitUrlUpdateError, setCustomLivekitUrlUpdateError] =
|
||||||
useState<string | null>(null);
|
useState<string | null>(null);
|
||||||
const [customLivekitUrl, setCustomLivekitUrl] = useSetting(
|
const [customLivekitUrl, setCustomLivekitUrl] = useSetting(
|
||||||
@@ -227,6 +232,20 @@ export const DeveloperSettingsTab: FC<Props> = ({
|
|||||||
)}
|
)}
|
||||||
/>{" "}
|
/>{" "}
|
||||||
</FieldRow>
|
</FieldRow>
|
||||||
|
<FieldRow>
|
||||||
|
<InputField
|
||||||
|
id="enableLivekitExtendedLogs"
|
||||||
|
type="checkbox"
|
||||||
|
label="Enable extended livekit logs"
|
||||||
|
checked={enableExtendedLivekitLogs}
|
||||||
|
onChange={useCallback(
|
||||||
|
(event: ChangeEvent<HTMLInputElement>): void => {
|
||||||
|
setEnableExtendedLivekitLogs(event.target.checked);
|
||||||
|
},
|
||||||
|
[setEnableExtendedLivekitLogs],
|
||||||
|
)}
|
||||||
|
/>{" "}
|
||||||
|
</FieldRow>
|
||||||
<EditInPlace
|
<EditInPlace
|
||||||
onSubmit={(e) => e.preventDefault()}
|
onSubmit={(e) => e.preventDefault()}
|
||||||
helpLabel={
|
helpLabel={
|
||||||
|
|||||||
@@ -129,6 +129,11 @@ export const alwaysShowIphoneEarpiece = new Setting<boolean>(
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const enableExtendedLivekitLogs = new Setting<boolean>(
|
||||||
|
"extended-livekit-logs",
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
|
||||||
export enum MatrixRTCMode {
|
export enum MatrixRTCMode {
|
||||||
Legacy = "legacy",
|
Legacy = "legacy",
|
||||||
Compatibility = "compatibility",
|
Compatibility = "compatibility",
|
||||||
|
|||||||
Reference in New Issue
Block a user