feat: add logging back

This commit is contained in:
Lucaskyy 2022-06-22 16:25:04 +02:00
parent 8c325af0f9
commit 4a23cb69bc
No known key found for this signature in database
GPG Key ID: 1530BFF96D1EEB89
2 changed files with 28 additions and 1 deletions

View File

@ -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
@ -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
)
)

View File

@ -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")
}
}