Awesome Open Source
Awesome Open Source

Crashy

A small Android library written entirely in Kotlin to collect crash reports and save them to storage.

Kotlin Platform API API

Usage

  1. Add JitPack to your project build.gradle
allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
   }
}
  1. Add the dependency in the application build.gradle
dependencies {
    //crashy
    implementation 'com.github.FunkyMuse:Crashy:$version'
  }
  1. In your application build.gradle add
   compileOptions {
        sourceCompatibility = 11
        targetCompatibility = 11
    }

    kotlinOptions {
        jvmTarget = "11"
    }
  1. Inside your AndroidManifest.xml file
 <provider
   android:name="androidx.startup.InitializationProvider"
   android:authorities="${applicationId}.androidx-startup"
   android:exported="false"
   tools:node="merge">
       <meta-data
          android:name="com.crazylegend.crashyreporter.initializer.CrashyInitializer"
          android:value="androidx.startup" />
</provider>

Screens of how the stack trace info looks like

  1. How to use?

Get logs

//as a list of strings
CrashyReporter.getLogsAsStrings()

//as a list of files
CrashyReporter.getLogFiles()

Get all logs and purge them afterwards

//as a list of strings
CrashyReporter.getLogsAsStringsAndPurge()

//as a list of files
CrashyReporter.getLogFilesAndPurge()

Manually log an exception

CrashyReporter.logException(thread: Thread, throwable: Throwable)

CrashyReporter.logException(exception: Throwable)

Purge logs

CrashyReporter.purgeLogs()

Get dump folder

val folder: File = CrashyReporter.dumpFolder

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

Apache 2.0


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Kotlin (61,662
Crash Reporting (200
Crashlytics (72
Crash Reports (67
Crash Reporting Tool (45
Crash Dump (24
Crashes (21
Crashlytics Logging (3
Crash Reporter (2
Related Projects