Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add the username when reporting a Non-Fatal Error?

I'm using the Crashlytics.logException() method when I want to programmatically report a non-fatal error on Crashlytics.

Although I set up a valid identifier for the current logged user when the application starts, with Crashlytics.setUserName(), I can't see this information in the dashboard. Instead, it appears only when there is a crash (see picture).

enter image description here

How can I enable it for non-fatal errors too?

EDIT: I'm using Crashlytics plugin for Eclipse, 1.7.0

like image 996
TheUnexpected Avatar asked Feb 12 '23 16:02

TheUnexpected


2 Answers

The username info will appear at non-fatal crashes too. Can you please check if the call to Crashlytics.setUsername() is being done before the Crashlytics.logException()?

See the screenshot below:

screenshot

However, the logging of messages are currently not synchronously, so if the crash occurs quickly, all or none of these statements can make it over. The writing of the data is done in a background thread, so the crash that is processing will always trump the other thread, so in this case, the crash will always trump when the log is bring written even though it might've started up first.

like image 174
Cipriani Avatar answered Feb 14 '23 07:02

Cipriani


I solved this simply by updating the Crashlytics library.

I still had the 1.7.0 version, without Fabric. I upgraded the account and I downloaded the new 2.0 package using the new guide and now I can see the user's information in all the non-fatal errors.

like image 21
TheUnexpected Avatar answered Feb 14 '23 07:02

TheUnexpected