Search code examples
crashlyticsgoogle-fabric

How to show custom logs from App to Crashlytics dashboard


I am trying to report custom logs from my app to Crashlytics without any crashes. I want to log a particular button action and display it in the Crashlytics dashboard. Is there a way to do this in Crashlytics?


Solution

  • - (void)recordError:(NSError *)error;
    - (void)recordError:(NSError *)error withAdditionalUserInfo:(nullable CLS_GENERIC_NSDICTIONARY(NSString *, id) *)userInfo;
    

    Just use the instance of Crashlytics and you can receive your non-fatal issue with the custom error.

    Also, you can send additional logs

    CLSLog(NSString *format, ...) 
    

    And will be helpful to use Answers if you need to see some actions statistic or events.

    + (void)logCustomEventWithName:(NSString *)eventName
              customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil;