mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-30 19:39:22 +00:00
dev-tool: Add option to enable extended livekit logs
This commit is contained in:
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 <></>;
|
||||
};
|
||||
Reference in New Issue
Block a user