Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rtc-no-ffi-log-capture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@livekit/rtc-node': patch
---

Stop capturing native logs: nothing consumed them, and every record down to trace level (including a libwebrtc dump of each data channel packet) was decoded and dispatched to every room. RUST_LOG now controls the native logs again.
26 changes: 26 additions & 0 deletions packages/livekit-rtc/src/ffi_client.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-FileCopyrightText: 2026 LiveKit, Inc.
//
// SPDX-License-Identifier: Apache-2.0
import type * as Bindings from '@livekit/rtc-ffi-bindings';
import { afterEach, describe, expect, it, vi } from 'vitest';

const { livekitInitialize } = vi.hoisted(() => ({ livekitInitialize: vi.fn() }));

vi.mock('@livekit/rtc-ffi-bindings', async () => ({
...(await vi.importActual<typeof Bindings>('@livekit/rtc-ffi-bindings')),
livekitInitialize,
}));

describe('FfiClient', () => {
afterEach(() => {
globalThis._ffiClientInstance = undefined;
});

it('leaves native logs to the native logger instead of forwarding them as FFI events', async () => {
const { FfiClient } = await import('./ffi_client.js');

void FfiClient.instance;

expect(livekitInitialize).toHaveBeenCalledWith(expect.any(Function), false, expect.any(String));
});
});
4 changes: 3 additions & 1 deletion packages/livekit-rtc/src/ffi_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export class FfiClient extends (EventEmitter as new () => TypedEmitter<FfiClient
const event = FfiEvent.fromBinary(event_data);
this.emit(FfiClientEvent.FfiEvent, event);
},
true,
// Nothing consumes forwarded logs, and capturing them forwards every native record down to
// trace level as an FFI event. Left uncaptured, the native logger honors RUST_LOG instead.
false,
SDK_VERSION,
);
}
Expand Down
Loading