Skip to content

Instantly share code, notes, and snippets.

@brunomikoski
Created April 1, 2015 18:18
Show Gist options
  • Save brunomikoski/1077c09c7f945a137a98 to your computer and use it in GitHub Desktop.
Save brunomikoski/1077c09c7f945a137a98 to your computer and use it in GitHub Desktop.
void OnEnable()
{
Application.RegisterLogCallback(HandleUnityLog);
}
private void OnDisable()
{
Application.RegisterLogCallback(null);
}
private void HandleUnityLog(string condition, string stacktrace, LogType type)
{
if (type != LogType.Error && type != LogType.Exception)
return;
BackendConnectionManager.LogoutUser();
ShowError(condition + "\n\nRestart the app and try again.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment