Skip to main content

What Problem Does This Solve?

During development, you want detailed logs to debug issues—what methods are called, what data is passed, when errors occur. In production, you want minimal logging to avoid performance overhead and log spam. LevelFilter controls how much the LCK SDK logs to the console, letting you dial logging verbosity up for debugging or down for release builds.

When to Use This

Set LevelFilter when:
  • Development: Use Debug or Trace to see detailed SDK behavior
  • Testing/QA: Use Info to see important events without noise
  • Production: Use Warn or Error to only log problems
  • Release builds: Use Off to disable all SDK logging

Quick Example

// Development build - verbose logging
#if DEVELOPMENT_BUILD
    LckCore.SetLogLevel(LevelFilter.Debug);
#else
    // Production - errors only
    LckCore.SetLogLevel(LevelFilter.Error);
#endif

Log Levels Explained

Off

No logging at all. The SDK produces zero console output. When to use:
  • Shipping builds where you don’t want any SDK logs
  • Performance-critical sections
  • Final release to customers
LckCore.SetLogLevel(LevelFilter.Off);
// SDK will produce no logs

Error

Critical errors only. Only logs when something breaks. When to use:
  • Production/release builds
  • You only want to know when things fail
  • Minimize log noise
What you’ll see:
  • Initialization failures
  • Recording errors
  • Permission denials
  • Platform incompatibility
LckCore.SetLogLevel(LevelFilter.Error);
// Example output:
// [LCK ERROR] Failed to start recording: NotEnoughStorageSpace
// [LCK ERROR] Microphone permission denied

Warn

Errors + warnings. Problems that might cause issues but aren’t critical. When to use:
  • Staging/beta builds
  • You want to catch potential issues before they become errors
  • Production with monitoring
What you’ll see:
  • Low storage warnings
  • Deprecated API usage
  • Suboptimal configurations
  • Performance concerns
LckCore.SetLogLevel(LevelFilter.Warn);
// Example output:
// [LCK WARN] Storage space low (< 500 MB remaining)
// [LCK WARN] Using deprecated method, migrate to XYZ
// [LCK ERROR] Recording failed

Info

Important events. SDK lifecycle events and state changes. When to use:
  • QA/testing builds
  • You want visibility into what the SDK is doing
  • Troubleshooting user reports
What you’ll see:
  • SDK initialization
  • Recording start/stop
  • Quality changes
  • Camera configuration
LckCore.SetLogLevel(LevelFilter.Info);
// Example output:
// [LCK INFO] LckCore initialized successfully
// [LCK INFO] Recording started at 1080p60
// [LCK INFO] Quality changed to Medium
// [LCK WARN] Storage low
// [LCK ERROR] Mic permission denied

Debug

Everything + debug details. Internal SDK operations and parameter values. When to use:
  • Active development
  • Debugging SDK integration issues
  • Understanding SDK behavior
  • Reproducing bugs
What you’ll see:
  • Method calls with parameters
  • Internal state changes
  • Configuration details
  • Data flow
LckCore.SetLogLevel(LevelFilter.Debug);
// Example output:
// [LCK DEBUG] SetActiveCaptureType(Recording)
// [LCK DEBUG] Applying quality option: High (1920x1080, 10Mbps, 60fps)
// [LCK DEBUG] Encoder initialized: H264, bitrate=10485760
// [LCK INFO] Recording started
// [LCK WARN] Storage: 450 MB remaining

Trace

Maximum verbosity. Frame-by-frame details, extremely detailed logging. When to use:
  • Deep debugging of specific issues
  • Understanding exact execution flow
  • Performance profiling
  • Reporting bugs to LIV support
Warning: Very high log volume, may impact performance. What you’ll see:
  • Every frame’s processing
  • Memory allocations
  • Texture updates
  • Encoder buffer states
  • Network packet details (streaming)
LckCore.SetLogLevel(LevelFilter.Trace);
// Example output:
// [LCK TRACE] Frame 1245: Capture started
// [LCK TRACE] Frame 1245: Texture copy (1920x1080, 8.2ms)
// [LCK TRACE] Frame 1245: Encoder input queued
// [LCK TRACE] Frame 1245: Audio buffer: 1024 samples
// [LCK DEBUG] Quality check: framerate stable at 60fps
// [LCK INFO] Recording at 00:01:23

Build TypeRecommended LevelRationale
Editor (Development)DebugSee what SDK is doing during integration
Development BuildInfoTrack SDK events without overwhelming detail
QA/Testing BuildWarnCatch warnings before release
Staging/BetaErrorProduction-like with error visibility
Release/ProductionOff or ErrorMinimize logs for performance and cleanliness

Common Patterns

Build-specific logging

void SetAppropriateLogLevel()
{
    #if UNITY_EDITOR
        // Verbose in editor
        LckCore.SetLogLevel(LevelFilter.Debug);
    #elif DEVELOPMENT_BUILD
        // Important events only
        LckCore.SetLogLevel(LevelFilter.Info);
    #else
        // Errors only in production
        LckCore.SetLogLevel(LevelFilter.Error);
    #endif
    
    Debug.Log($"LCK log level: {GetCurrentLogLevel()}");
}

Runtime toggle (debug menu)

public class DebugMenu : MonoBehaviour
{
    private LevelFilter currentLevel = LevelFilter.Info;
    
    void OnGUI()
    {
        if (GUILayout.Button("Cycle Log Level"))
        {
            currentLevel = currentLevel switch
            {
                LevelFilter.Off => LevelFilter.Error,
                LevelFilter.Error => LevelFilter.Warn,
                LevelFilter.Warn => LevelFilter.Info,
                LevelFilter.Info => LevelFilter.Debug,
                LevelFilter.Debug => LevelFilter.Trace,
                _ => LevelFilter.Off
            };
            
            LckCore.SetLogLevel(currentLevel);
            Debug.Log($"LCK log level: {currentLevel}");
        }
        
        GUILayout.Label($"Current Level: {currentLevel}");
    }
}

Platform-specific

void InitializeLCK()
{
    // More verbose logging on desktop for debugging
    var logLevel = Application.platform switch
    {
        RuntimePlatform.WindowsEditor => LevelFilter.Debug,
        RuntimePlatform.OSXEditor => LevelFilter.Debug,
        RuntimePlatform.WindowsPlayer => LevelFilter.Warn,
        RuntimePlatform.OSXPlayer => LevelFilter.Warn,
        RuntimePlatform.Android => LevelFilter.Error,
        RuntimePlatform.IPhonePlayer => LevelFilter.Error,
        _ => LevelFilter.Info
    };
    
    LckCore.SetLogLevel(logLevel);
    Debug.Log($"LCK logging: {logLevel} on {Application.platform}");
}

Temporary verbose logging for debugging

void DebugRecordingIssue()
{
    // Save current level
    var originalLevel = GetCurrentLogLevel();
    
    // Temporarily enable trace logging
    LckCore.SetLogLevel(LevelFilter.Trace);
    
    // Perform problematic operation
    var result = lckService.StartRecording();
    
    // Restore original level
    LckCore.SetLogLevel(originalLevel);
}

Enum Values

LevelValueOutputPerformance Impact
OffSilentNothingNone
ErrorErrors onlyCritical failuresMinimal
WarnErrors + warningsPotential problemsMinimal
InfoImportant eventsSDK lifecycleLow
DebugDetailed infoInternal operationsModerate
TraceEverythingFrame-by-frameHigh

API Reference

Set Log Level

void LckCore.SetLogLevel(LevelFilter level)
Parameters:
  • level — Desired logging verbosity
Example:
LckCore.SetLogLevel(LevelFilter.Debug);

Performance Considerations

Trace logging can impact performance — especially at high framerates (60+ fps). Use only for debugging specific issues.
Impact by level:
  • Off, Error, Warn — Negligible impact
  • Info — Very low impact (under 1% typical)
  • Debug — Low impact (1-3% typical)
  • Trace — Moderate impact (5-10% possible)
Best practice: Ship production builds with Error or Off.

Debugging Tips

Capture logs to file

void Start()
{
    // Enable detailed logging for bug reports
    LckCore.SetLogLevel(LevelFilter.Debug);
    
    // Unity captures to log file automatically
    Debug.Log("Log location: " + Application.persistentDataPath);
}

Conditional compilation

#if DEBUG_LCK
    LckCore.SetLogLevel(LevelFilter.Trace);
#else
    LckCore.SetLogLevel(LevelFilter.Error);
#endif
Define DEBUG_LCK in Player Settings → Scripting Define Symbols when debugging.

Best Practices

Set early — Configure log level in Awake() before SDK initialization
Build-specific — Use preprocessor directives for different builds
Ship clean — Use Error or Off in production
Debug temporarily — Increase verbosity when debugging, restore after
Don’t leave Trace enabled — High performance cost, huge log files