简体   繁体   中英

Access to Crashlytics log outside a crash

Is there a way to access the crashlytics log outside of a crash event?

I was hoping to find something like

Crashlytics.instance.currentLog() -> [String]

We would like to give our (internal) users a feedback button that sends us email with the user's input and also a copy of the current crashlytics log - so we can see how they got to the point they are asking the question.

Mike from Crashlytics and Fabric here.

You could create a logged error using:

Objective-C:

[CrashlyticsKit recordError:error];

Swift:

Crashlytics.sharedInstance().recordError(error)

and also record the user's email address with:

Objective-C:

[CrashlyticsKit setUserEmail:@"person@domain.com"];

Swift:

Crashlytics.sharedInstance().setUserEmail("person@domain.com")

and then run a search on the user's email address whenever they report this. You would need to cause an error of some kind, but that could get you the data you're looking for.

Documentation on logged errors and user identifiers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM