quickstart-unity icon indicating copy to clipboard operation
quickstart-unity copied to clipboard

[Question] Is it possible to logging an error when using Debug.LogError?

Open oliverebert opened this issue 3 years ago • 4 comments

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2020.3.10
  • Firebase Unity SDK version: 8.1.0
  • Source you installed the SDK: unitypackage
  • Problematic Firebase Component: Crashlytics
  • Other Firebase Components in use: Analytics
  • Additional SDKs you are using: Facebook
  • Platform you are using the Unity editor on Windows
  • Platform you are targeting: Android
  • Scripting Runtime: IL2CPP

[REQUIRED] Please describe the question here:

Is it possible to logging an error when using Debug.LogError. Right now I've gotten around this by throwing a new Exception with the message passed into Debug.LogError, Is it possible to send the Debug.LogError output to Crashlytics?

oliverebert avatar Aug 19 '21 10:08 oliverebert

Hi @oliverebert,

Firebase doesn't recognize debug logging of errors as a crash because they're primarily used in showing error messages in the Unity console. Throwing an exception is the way to go when logging non-fatal crashes in the console.

Let me know if this is a feature you want implemented.

paulinon avatar Aug 19 '21 11:08 paulinon

Hi @paulinon

yes we don't really differentiate between exception and log error. We are interested in any misbehavior in the Dev Client and we have always output this via Debug.LogError and would send exactly this to Crashlytics.

oliverebert avatar Aug 19 '21 13:08 oliverebert

@paulinon

I have another question about this topic: Is it possible to send the custom exceptions from UnityEditor to Firebase Crashlytics and not only the ones coming from the Anndroid or iOS device?

oliverebert avatar Aug 24 '21 09:08 oliverebert

Hi @oliverebert,

It's not possible for the editor to report custom exceptions. When the app is restarted on the device, that's when the crash is reported to Firebase.

paulinon avatar Aug 24 '21 16:08 paulinon