🔇(frontend) remove LiveKit logs in production
Enabling logs by default in clients during production feels insecure. Therefore, I have silenced all LiveKit logs. This might pose a challenge if we need to debug a user in the future, but currently, we don’t require these logs. Additionally, my utils file and function work as intended, though there is room for improvement.
This commit is contained in:
committed by
aleb_the_flash
parent
fb0ee9e8f6
commit
1971f594cf
@@ -10,12 +10,17 @@ import { Layout } from './layout/Layout'
|
||||
import { NotFoundScreen } from './components/NotFoundScreen'
|
||||
import { routes } from './routes'
|
||||
import './i18n/init'
|
||||
import { silenceLiveKitLogs } from "@/utils/livekit.ts";
|
||||
|
||||
const queryClient = new QueryClient()
|
||||
|
||||
function App() {
|
||||
const { i18n } = useTranslation()
|
||||
useLang(i18n.language)
|
||||
|
||||
const isProduction = import.meta.env.PROD
|
||||
silenceLiveKitLogs(isProduction)
|
||||
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<Suspense fallback={null}>
|
||||
|
||||
6
src/frontend/src/utils/livekit.ts
Normal file
6
src/frontend/src/utils/livekit.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { LogLevel, setLogLevel } from "livekit-client";
|
||||
|
||||
|
||||
export const silenceLiveKitLogs = (shouldSilenceLogs: boolean) => {
|
||||
setLogLevel(shouldSilenceLogs ? LogLevel.silent : LogLevel.debug);
|
||||
}
|
||||
Reference in New Issue
Block a user