From de4157046812b215758418c873869ca1313e6893 Mon Sep 17 00:00:00 2001 From: Aditya Bavadekar Date: Wed, 6 Jul 2022 15:06:24 +0530 Subject: [PATCH] Update for v1.0.0 (2) --- .../com/adityaamolbavadekar/pinlog/PinLog.kt | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pinlog/src/main/java/com/adityaamolbavadekar/pinlog/PinLog.kt b/pinlog/src/main/java/com/adityaamolbavadekar/pinlog/PinLog.kt index d891419..7464958 100644 --- a/pinlog/src/main/java/com/adityaamolbavadekar/pinlog/PinLog.kt +++ b/pinlog/src/main/java/com/adityaamolbavadekar/pinlog/PinLog.kt @@ -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?, @@ -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?,