Skip to content

Use Utils logging helpers instead of raw Debug.Log in SDK runtime#299

Merged
MaxHeimbrock merged 1 commit into
mainfrom
max/sdk-logging-utils
Jun 10, 2026
Merged

Use Utils logging helpers instead of raw Debug.Log in SDK runtime#299
MaxHeimbrock merged 1 commit into
mainfrom
max/sdk-logging-utils

Conversation

@MaxHeimbrock

Copy link
Copy Markdown
Contributor

What

Replaces the four remaining raw UnityEngine.Debug.Log* calls in the SDK runtime (Runtime/Scripts/, excluding generated Proto/) with the SDK's Utils logging helpers, so all runtime logging follows the established convention: LK_DEBUG-gated for debug, and "LiveKit"-prefixed.

File Before After Rationale
RtcAudioSource.cs UnityEngine.Debug.Log Utils.Debug Informational; matches the Utils.Debug neighbor and drops the explicit qualifier previously needed to disambiguate from System.Diagnostics.Debug
RtcVideoSource.cs Debug.Log Utils.Debug Dispose-path diagnostic
Rpc.cs Debug.Log Utils.Debug RPC errors are often normal app-level results — shouldn't spam release logs
TokenSourceComponent.cs Debug.LogWarning Utils.Warning Genuine developer misconfiguration warning; should stay visible in all builds

Supporting changes:

  • Added using LiveKit.Internal; to Rpc.cs and TokenSourceComponent.cs (where Utils lives).
  • Removed the now-unused using UnityEngine; from Rpc.cs.

Effect

The three Utils.Debug conversions now compile out unless LK_DEBUG is defined (quieter release builds); the Utils.Warning keeps the token-source warning visible and gains the "LiveKit" prefix.

Verification

Compiled the SDK runtime assembly via dotnet build on LiveKit.csprojbuild succeeded, 0 errors (22 pre-existing, unrelated warnings).

🤖 Generated with Claude Code

Replace the four remaining UnityEngine.Debug.Log* calls in the runtime
with the SDK's Utils logging helpers so they follow the established
convention (LK_DEBUG-gated, "LiveKit"-prefixed):

- RtcAudioSource / RtcVideoSource / Rpc: Utils.Debug (compiled out unless
  LK_DEBUG is defined; RPC errors are often normal app-level results)
- TokenSourceComponent: Utils.Warning (developer misconfiguration that
  should stay visible in all builds)

Adds the LiveKit.Internal using to Rpc and TokenSourceComponent, and drops
the now-unused UnityEngine using from Rpc.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MaxHeimbrock MaxHeimbrock merged commit cd81bf3 into main Jun 10, 2026
28 of 31 checks passed
@MaxHeimbrock MaxHeimbrock deleted the max/sdk-logging-utils branch June 10, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant