From 260c49d8d5881cb2e32ebca761dbd94a2c590d4d Mon Sep 17 00:00:00 2001 From: William Brawner Date: Sun, 21 Feb 2021 17:29:02 -0700 Subject: [PATCH] Fix PersistentTree logging to append --- .../java/com/wbrawner/simplemarkdown/utility/PersistentTree.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/utility/PersistentTree.kt b/app/src/main/java/com/wbrawner/simplemarkdown/utility/PersistentTree.kt index fa9750a..33fb08f 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/utility/PersistentTree.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/utility/PersistentTree.kt @@ -8,6 +8,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import timber.log.Timber import java.io.File +import java.io.FileOutputStream import java.io.IOException import java.io.PrintStream import java.text.SimpleDateFormat @@ -35,7 +36,7 @@ class PersistentTree private constructor(private val logFile: File) : Timber.Tre Log.WARN -> "W" else -> "U" } - logFile.outputStream().use { stream -> + FileOutputStream(logFile, true).use { stream -> stream.bufferedWriter().use { it.appendLine("$timestamp $priorityLetter/${tag ?: "SimpleMarkdown"}: $message") }