Skip to content

Commit

Permalink
feat: flush logs on read
Browse files Browse the repository at this point in the history
  • Loading branch information
ViscousPot committed Jul 5, 2024
1 parent 2d57050 commit 02e7d76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/com/viscouspot/gitsync/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ class MainActivity : AppCompatActivity() {
}

viewLogs.setOnClickListener {
Logger.flushLogs(this)
val file = File(filesDir, "logs.txt")
if (file.exists()) {
val clipboardManager = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/viscouspot/gitsync/util/Logger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ object Logger {
private fun createBugReportEmailIntent(context: Context): Intent {
val recipient = "bugs.viscouspotential@gmail.com"

flushLogs(context)

val file = File(context.filesDir, "logs.txt")
val fileUri = FileProvider.getUriForFile(context, "${context.packageName}.provider", file)

Expand Down

0 comments on commit 02e7d76

Please sign in to comment.