Skip to content

Commit

Permalink
fix: fixed rare crash on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
timschneeb committed Dec 13, 2024
1 parent 55c018a commit 2310bec
Showing 1 changed file with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,23 @@ open class MainApplication : Application(), SharedPreferences.OnSharedPreference
// Clean up
Cache.cleanup(this)

Timber.plant(FileLoggerTree.Builder()
.withFileName("application.log")
.withDirName(this.cacheDir.absolutePath)
.withMinPriority(Log.VERBOSE)
.withSizeLimit(2 * 1000000)
.withFileLimit(1)
.appendToFile(false)
.build())
try {
Timber.plant(
FileLoggerTree.Builder()
.withFileName("application.log")
.withDirName(this.cacheDir.absolutePath)
.withMinPriority(Log.VERBOSE)
.withSizeLimit(2 * 1000000)
.withFileLimit(1)
.appendToFile(false)
.build()
)
}
catch (ex: Exception) {
// Log file creation may fail
Timber.e(ex)
}

Timber.i("====> Application starting up")

val dumpFile = File(filesDir, "dump.txt")
Expand Down

0 comments on commit 2310bec

Please sign in to comment.