Plausible CrashReporter
|
Crash Reporter. More...
Inherits NSObject.
Instance Methods | |
(instancetype) | - initWithConfiguration: |
Initialize a new PLCrashReporter instance with the given configuration. More... | |
(BOOL) | - hasPendingCrashReport |
Returns YES if the application has previously crashed and an pending crash report is available. | |
(NSData *) | - loadPendingCrashReportData |
If an application has a pending crash report, this method returns the crash report data. More... | |
(NSData *) | - loadPendingCrashReportDataAndReturnError: |
If an application has a pending crash report, this method returns the crash report data. More... | |
(NSData *) | - generateLiveReportWithThread: |
Generate a live crash report for a given thread, without triggering an actual crash condition. More... | |
(NSData *) | - generateLiveReportWithThread:error: |
Generate a live crash report for a given thread, without triggering an actual crash condition. More... | |
(NSData *) | - generateLiveReport |
Generate a live crash report, without triggering an actual crash condition. More... | |
(NSData *) | - generateLiveReportAndReturnError: |
Generate a live crash report for the current thread, without triggering an actual crash condition. More... | |
(BOOL) | - purgePendingCrashReport |
Purge a pending crash report. More... | |
(BOOL) | - purgePendingCrashReportAndReturnError: |
Purge a pending crash report. More... | |
(BOOL) | - enableCrashReporter |
Enable the crash reporter. More... | |
(BOOL) | - enableCrashReporterAndReturnError: |
Enable the crash reporter. More... | |
(void) | - setCrashCallbacks: |
Set the callbacks that will be executed by the receiver after a crash has occured and been recorded by PLCrashReporter. More... | |
Class Methods | |
(PLCrashReporter *) | + sharedReporter |
Return the default crash reporter instance. More... | |
Crash Reporter.
A PLCrashReporter instance manages process-wide handling of crashes.
- (BOOL) enableCrashReporter |
Enable the crash reporter.
Once called, all application crashes will result in a crash report being written prior to application exit.
Only one PLCrashReporter instance may be enabled in a process; attempting to enable an additional instance will return NO, and the reporter will not be enabled. This restriction may be removed in a future release.
- (BOOL) enableCrashReporterAndReturnError: | (NSError **) | outError |
Enable the crash reporter.
Once called, all application crashes will result in a crash report being written prior to application exit.
This method must only be invoked once. Further invocations will throw a PLCrashReporterException.
outError | A pointer to an NSError object variable. If an error occurs, this pointer will contain an error in the PLCrashReporterErrorDomain indicating why the Crash Reporter could not be enabled. If no error occurs, this parameter will be left unmodified. You may specify nil for this parameter, and no error information will be provided. |
Only one PLCrashReporter instance may be enabled in a process; attempting to enable an additional instance will return NO and a PLCrashReporterErrorResourceBusy error, and the reporter will not be enabled. This restriction may be removed in a future release.
- (NSData *) generateLiveReport |
Generate a live crash report, without triggering an actual crash condition.
This may be used to log current process state without actually crashing. The crash report data will be returned on success.
- (NSData *) generateLiveReportAndReturnError: | (NSError **) | outError |
Generate a live crash report for the current thread, without triggering an actual crash condition.
This may be used to log current process state without actually crashing. The crash report data will be returned on success.
outError | A pointer to an NSError object variable. If an error occurs, this pointer will contain an error object indicating why the pending crash report could not be generated or loaded. If no error occurs, this parameter will be left unmodified. You may specify nil for this parameter, and no error information will be provided. |
- (NSData *) generateLiveReportWithThread: | (thread_t) | thread |
Generate a live crash report for a given thread, without triggering an actual crash condition.
This may be used to log current process state without actually crashing. The crash report data will be returned on success.
thread | The thread which will be marked as the failing thread in the generated report. |
- (NSData *) generateLiveReportWithThread: | (thread_t) | thread | |
error: | (NSError **) | outError | |
Generate a live crash report for a given thread, without triggering an actual crash condition.
This may be used to log current process state without actually crashing. The crash report data will be returned on success.
thread | The thread which will be marked as the failing thread in the generated report. |
outError | A pointer to an NSError object variable. If an error occurs, this pointer will contain an error object indicating why the crash report could not be generated or loaded. If no error occurs, this parameter will be left unmodified. You may specify nil for this parameter, and no error information will be provided. |
- (instancetype) initWithConfiguration: | (PLCrashReporterConfig *) | configuration |
Initialize a new PLCrashReporter instance with the given configuration.
configuration | The configuration to be used by this reporter instance. |
- (NSData *) loadPendingCrashReportData |
If an application has a pending crash report, this method returns the crash report data.
You may use this to submit the report to your own HTTP server, over e-mail, or even parse and introspect the report locally using the PLCrashReport API.
- (NSData *) loadPendingCrashReportDataAndReturnError: | (NSError **) | outError |
If an application has a pending crash report, this method returns the crash report data.
You may use this to submit the report to your own HTTP server, over e-mail, or even parse and introspect the report locally using the PLCrashReport API.
outError | A pointer to an NSError object variable. If an error occurs, this pointer will contain an error object indicating why the pending crash report could not be loaded. If no error occurs, this parameter will be left unmodified. You may specify nil for this parameter, and no error information will be provided. |
- (BOOL) purgePendingCrashReport |
Purge a pending crash report.
- (BOOL) purgePendingCrashReportAndReturnError: | (NSError **) | outError |
Purge a pending crash report.
- (void) setCrashCallbacks: | (PLCrashReporterCallbacks *) | callbacks |
Set the callbacks that will be executed by the receiver after a crash has occured and been recorded by PLCrashReporter.
callbacks | A pointer to an initialized PLCrashReporterCallbacks structure. |
+ (PLCrashReporter *) sharedReporter |
Return the default crash reporter instance.
The returned instance will be configured appropriately for release deployment.