Debug Events

Overview

Occasionally, your game will encounter issues after it’s been released that aren’t consistently reproducible in testing, if at all. You can use Debug events as a way to notify your team when exceptions get thrown in your game, and you can track the exception message in the event. Debug events can also be used during development to track arbitrary data points so you can make sure your code is doing what it’s expected to do, e.g. track that data was successfully loaded from a server.

Additionally, sometimes it is expected that some errors will get encountered. In these situations, you can use the Error event and assign a category to that event, e.g. “Warning” or “Critical”.

Available Events

  • debug_event
  • error_event

Critical Parameters

EventRequired ParametersOptional Parameters
debug_eventmessage The debug message you wish to capture — can be an exception message or any arbitrary string.N/A
error_event

message The debug message you wish to capture — can be an exception message or any arbitrary string.

error_type The type of error being captured, must be one of the following:

  • Undefined
  • Debug
  • Info
  • Warning
  • Error
  • Critical
N/A

Examples

debug_event

  • You can use a debug_event to track possible cheaters in your game. If there is a certain area in your game you know the user shouldn’t be able to access yet, or if you have other conditions that you know a player shouldn’t be able to meet, you can use a debug_event to track that information.

error_event

  • You can use error_events as part of a global exception-handling framework in your game. Rather than writing try/catch blocks throughout your code to catch unhandled exceptions, Unity supports a global exception handler, which is a single function that can be called any time an exception is thrown in your game and isn’t handled. You can then track these exceptions in one place and fire an error_event whenever they occur, giving you insight into overall health and performance of your game.

Event Validation

For each relevant event, check the following using the guide here: Validation

  • The event name appears
  • The critical parameters of the events are present

Dashboard & Analysis

Looker Explore & Dashboards

For Debug events and Error events, there aren’t any dedicated Looker Explores or Dashboards. These events can just be seen in the Raw Events Explore.