fix: logs export bug, export file naming

This commit is contained in:
Zane Schepke
2025-09-26 09:46:30 -04:00
parent acdefd80fa
commit 7c3eabb19b
9 changed files with 79 additions and 29 deletions
@@ -8,7 +8,7 @@ interface LogReader {
fun stop()
fun zipLogFiles(path: String)
suspend fun zipLogFiles(path: String)
suspend fun deleteAndClearLogs()
@@ -1,5 +1,6 @@
package com.zaneschepke.logcatter
import android.R.attr.path
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import com.zaneschepke.logcatter.model.LogMessage
@@ -61,15 +62,13 @@ class LogcatManager(pid: Int, logDir: String, maxFileSize: Long, maxFolderSize:
isStarted = false
}
override fun zipLogFiles(path: String) {
logScope.launch {
val wasStarted = isStarted
stop()
fileManager.zipLogs(path)
if (wasStarted) {
logcatReader.clearLogs()
start()
}
override suspend fun zipLogFiles(path: String) {
val wasStarted = isStarted
stop()
fileManager.zipLogs(path)
if (wasStarted) {
logcatReader.clearLogs()
start()
}
}