Skip to content

Commit

Permalink
Update for v1.0.0 (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaBavadekar committed Jul 6, 2022
1 parent de419a9 commit de41570
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions pinlog/src/main/java/com/adityaamolbavadekar/pinlog/PinLog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1194,10 +1194,26 @@ object PinLog {
}
}

/**
* This class helps in creating reports and sending that report.
* @see CrashReporter.createReport
* @see CrashReporter.sendCrashReportWithEmail
*
* */
class CrashReporter {

private var crashData: JSONObject = JSONObject()

/**
* Creates a report that includes
* data from [CustomLogFileData], your PinLogs,
* applicationInfo, BuildConfig if was provided while
* initialisation.
*
* The report returned is a [JSONObject] whose key
* can be retrieved from [CrashDataKeys].
*
* */
fun createReport(
t: Thread,
e: Throwable?,
Expand All @@ -1206,6 +1222,22 @@ object PinLog {
return crashData
}

/**
* Creates a report that includes
* data from [CustomLogFileData], your PinLogs,
* applicationInfo, BuildConfig if was provided while
* initialisation.
*
* The generated Report is added as an attachment
* to an Email Intent.
*
* if the [PinLog.setupPinLogExceptionHandler] method was used by you in Application class,
* This method is called whenever a Crash occurs.
*
* *Note : The Application is force closed after sending Email to
* avoid any ANRs.*
*
* */
fun sendCrashReportWithEmail(
t: Thread,
e: Throwable?,
Expand Down

0 comments on commit de41570

Please sign in to comment.