Skip to content

Commit

Permalink
feat: add logging back
Browse files Browse the repository at this point in the history
  • Loading branch information
Sculas committed Jun 22, 2022
1 parent 8c325af commit 4a23cb6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/kotlin/app/revanced/cli/command/MainCommand.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app.revanced.cli.command

import app.revanced.cli.patcher.Patcher
import app.revanced.cli.patcher.PatcherLogger
import app.revanced.cli.signing.Signing
import app.revanced.cli.signing.SigningOptions
import app.revanced.patcher.PatcherOptions
Expand Down Expand Up @@ -91,7 +92,10 @@ internal object MainCommand : Runnable {

val patcher = app.revanced.patcher.Patcher(
PatcherOptions(
args.inputFile, args.cacheDirectory, !args.disableResourcePatching
args.inputFile,
args.cacheDirectory,
!args.disableResourcePatching,
logger = PatcherLogger
)
)

Expand Down
23 changes: 23 additions & 0 deletions src/main/kotlin/app/revanced/cli/patcher/PatcherLogger.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package app.revanced.cli.patcher

import app.revanced.patcher.PatchLogger

object PatcherLogger : PatchLogger {
private const val prefix = "[patcher]"

override fun error(msg: String) {
println("error: $prefix: $msg")
}

override fun info(msg: String) {
println("info: $prefix: $msg")
}

override fun trace(msg: String) {
println("trace: $prefix: $msg")
}

override fun warn(msg: String) {
println("warn: $prefix: $msg")
}
}

0 comments on commit 4a23cb6

Please sign in to comment.