Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Create logDir (not exist) when initializing
Browse files Browse the repository at this point in the history
  • Loading branch information
SanmerDev committed Jun 6, 2023
1 parent 4971a8f commit dedc592
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/src/main/kotlin/com/sanmer/geomag/utils/log/Logcat.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ object Logcat {

private val logFile by lazy { context.logDir.resolve(fileName) }

init {
context.logDir.apply {
if (!exists()) mkdirs()
}
}

fun getCurrent(): List<String> = try {
val command = arrayOf(
"logcat",
Expand Down

0 comments on commit dedc592

Please sign in to comment.