feat: properly make use of logging facade

This commit is contained in:
oSumAtrIX
2023-08-24 04:41:44 +02:00
parent 45dd15f679
commit 41898d7547
12 changed files with 79 additions and 104 deletions

View File

@@ -6,12 +6,15 @@ import app.revanced.utils.Options.setOptions
import picocli.CommandLine
import picocli.CommandLine.Help.Visibility.ALWAYS
import java.io.File
import java.util.logging.Logger
@CommandLine.Command(
name = "options",
description = ["Generate options file from patches"],
)
internal object OptionsCommand : Runnable {
private val logger = Logger.getLogger(OptionsCommand::class.java.name)
@CommandLine.Parameters(
description = ["Paths to patch bundles"],
arity = "1..*"
@@ -41,10 +44,10 @@ internal object OptionsCommand : Runnable {
override fun run() = if (!path.exists() || overwrite)
with(PatchBundleLoader.Jar(*patchBundles)) {
if (update) setOptions(path, logger)
if (update) setOptions(path)
Options.serialize(this, prettyPrint = true)
.let(path::writeText)
}
else logger.error("Options file already exists, use --override to override it")
else logger.severe("Options file already exists, use --override to override it")
}