Skip to main content

Debugging

Check SDK State

Debug.Log($"Initialized: {GameRebellion.IsInitialized}");
Debug.Log($"State: {GameRebellion.GetState()}");
Debug.Log($"Last Error: {GameRebellion.GetLastError()}");

Expected after successful init:

  • IsInitialized = true
  • GetState() = SdkState.Ready

Enable Log Draining

The SDK buffers logs in the native core. Surface them in the Unity Console:

gameObject.AddComponent<GRLogDrainer>();

GRLogDrainer periodically calls DrainAndLogSDKLogs() and prints native logs with the [GRC] prefix.

GRLogDrainer Configuration

FieldDefaultDescription
drainInterval1.0fSeconds between drain calls
enableLogDrainingtrueEnable/disable log draining

Force Flush

During testing, force-send all buffered events:

GameRebellion.Flush();

GRMetricsCollector

The auto-created metrics collector can be configured for debugging:

FieldDefaultDescription
trackFPStrueEnable FPS tracking
trackMemorytrueEnable memory tracking
logMetricsfalsePrint metrics to console
logInterval5fSeconds between console logs

Set logMetrics = true during development to see FPS and memory values in the console.

Network Debugging

// Force offline mode (events are queued locally)
GameRebellion.SetNetworkOnline(false);

// Re-enable network (queued events are sent)
GameRebellion.SetNetworkOnline(true);