diff --git a/.changeset/two-snails-lick.md b/.changeset/two-snails-lick.md new file mode 100644 index 0000000000..51dae87ba7 --- /dev/null +++ b/.changeset/two-snails-lick.md @@ -0,0 +1,5 @@ +--- +"livekit-client": patch +--- + +Send worker loglevel in init message diff --git a/src/e2ee/E2eeManager.ts b/src/e2ee/E2eeManager.ts index 36b2de392b..f482b8ccc1 100644 --- a/src/e2ee/E2eeManager.ts +++ b/src/e2ee/E2eeManager.ts @@ -1,6 +1,6 @@ import { EventEmitter } from 'events'; import type TypedEventEmitter from 'typed-emitter'; -import log from '../logger'; +import log, { LogLevel, workerLogger } from '../logger'; import { Encryption_Type, TrackInfo } from '../proto/livekit_models_pb'; import type RTCEngine from '../room/RTCEngine'; import type Room from '../room/Room'; @@ -68,6 +68,7 @@ export class E2EEManager extends (EventEmitter as new () => TypedEventEmitter { switch (kind) { case 'init': + workerLogger.setLevel(data.loglevel); workerLogger.info('worker initialized'); keyProviderOptions = data.keyProviderOptions; useSharedKey = !!data.keyProviderOptions.sharedKey; diff --git a/src/logger.ts b/src/logger.ts index 31b15b2e05..95735dba3d 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -31,6 +31,8 @@ export type StructuredLogger = { warn: (msg: string, context?: object) => void; error: (msg: string, context?: object) => void; setDefaultLevel: (level: log.LogLevelDesc) => void; + setLevel: (level: log.LogLevelDesc) => void; + getLevel: () => number; }; let livekitLogger = log.getLogger('livekit');