Plausible CrashReporter
Instance Methods | Class Methods | List of all members
PLCrashReporter Class Reference

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...
 

Detailed Description

Crash Reporter.

A PLCrashReporter instance manages process-wide handling of crashes.

Method Documentation

- (BOOL) enableCrashReporter

Enable the crash reporter.

Once called, all application crashes will result in a crash report being written prior to application exit.

Returns
Returns YES on success, or NO if the crash reporter could not be enabled.
Registering Multiple Reporters

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.

Parameters
outErrorA 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.
Returns
Returns YES on success, or NO if the crash reporter could not be enabled.
Registering Multiple Reporters

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.

Returns
Returns nil if the crash report data could not be loaded.
- (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.

Parameters
outErrorA 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.
Returns
Returns nil if the crash report data could not be loaded.
- (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.

Parameters
threadThe thread which will be marked as the failing thread in the generated report.
Returns
Returns nil if the crash report data could not be generated.
See Also
PLCrashReporter::generateLiveReportWithMachThread:error:
- (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.

Parameters
threadThe thread which will be marked as the failing thread in the generated report.
outErrorA 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.
Returns
Returns nil if the crash report data could not be loaded.
- (instancetype) initWithConfiguration: (PLCrashReporterConfig *)  configuration

Initialize a new PLCrashReporter instance with the given configuration.

Parameters
configurationThe 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.

Returns
Returns nil if the crash report data could not be loaded.
- (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.

Parameters
outErrorA 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.
Returns
Returns nil if the crash report data could not be loaded.
- (BOOL) purgePendingCrashReport

Purge a pending crash report.

Returns
Returns YES on success, or NO on error.
- (BOOL) purgePendingCrashReportAndReturnError: (NSError **)  outError

Purge a pending crash report.

Returns
Returns YES on success, or NO on error.
- (void) setCrashCallbacks: (PLCrashReporterCallbacks *)  callbacks

Set the callbacks that will be executed by the receiver after a crash has occured and been recorded by PLCrashReporter.

Parameters
callbacksA pointer to an initialized PLCrashReporterCallbacks structure.
Note
This method must be called prior to enableCrashReporter or enableCrashReporterAndReturnError:
See Also
Async-Safe Programming Guide
+ (PLCrashReporter *) sharedReporter

Return the default crash reporter instance.

The returned instance will be configured appropriately for release deployment.

Deprecated:
As of PLCrashReporter 1.2, the default reporter instance has been deprecated, and API clients should initialize a crash reporter instance directly.

The documentation for this class was generated from the following files: