Debugging Your Code with Teak

Sometimes things go wrong, Teak does its best to inform the user when things do. Teak also sends a steady stream of information about things which have gone properly.

While you can always go to the device logs to see this information, we’ve made it possible to programmatically deal with events and/or format them into your own logging solution.

Getting Log Events from Teak

Teak communicates via semi-structured log events. You can view these in the device logs, but we also expose an event that you can use to listen for these logs inside Unity, as well as a wrapper class to help work with the log messages.

Listening for Log Events

Create a handler for log events:

void HandleLogEvent(Dictionary<string, object> logData) {
    Debug.Log(new TeakLogEvent(logData));
}
csharp

And assign it to OnLogEvent:

Teak.Instance.OnLogEvent += HandleLogEvent;
csharp

See TeakLogEvent for more details.