Skip to content

Commit

Permalink
fix: print stack trace when a patch failed
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Aug 24, 2023
1 parent 8dd709b commit 924c1f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/kotlin/app/revanced/cli/command/PatchCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import kotlinx.coroutines.runBlocking
import picocli.CommandLine
import picocli.CommandLine.Help.Visibility.ALWAYS
import java.io.File
import java.io.PrintWriter
import java.io.StringWriter
import java.util.logging.Logger


Expand Down Expand Up @@ -174,7 +176,10 @@ internal object PatchCommand : Runnable {
runBlocking {
apply(false).collect { patchResult ->
patchResult.exception?.let {
logger.severe("${patchResult.patchName} failed:\n${patchResult.exception}")
StringWriter().use { writer ->
it.printStackTrace(PrintWriter(writer))
logger.severe("${patchResult.patchName} failed: $writer")
}
} ?: logger.info("${patchResult.patchName} succeeded")
}
}
Expand Down

0 comments on commit 924c1f8

Please sign in to comment.