Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "INFO:" from the beginning of list-patches's output #301

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ import app.revanced.patcher.patch.options.PatchOption
import picocli.CommandLine.*
import picocli.CommandLine.Help.Visibility.ALWAYS
import java.io.File
import java.util.logging.Logger


@Command(name = "list-patches", description = ["List patches from supplied patch bundles."])
internal object ListPatchesCommand : Runnable {
private val logger = Logger.getLogger(ListPatchesCommand::class.java.name)

@Parameters(
description = ["Paths to patch bundles."], arity = "1..*"
)
Expand Down Expand Up @@ -51,7 +48,7 @@ internal object ListPatchesCommand : Runnable {

@Option(
names = ["-i", "--index"],
description = ["List the index of of each patch in relation to the supplied patch bundles."],
description = ["List the index of each patch in relation to the supplied patch bundles."],
showDefaultValue = ALWAYS
)
private var withIndex: Boolean = true
Expand Down Expand Up @@ -118,6 +115,6 @@ internal object ListPatchesCommand : Runnable {
val filtered =
packageName?.let { patches.filter { (_, patch) -> patch.filterCompatiblePackages(it) } } ?: patches

if (filtered.isNotEmpty()) logger.info(filtered.joinToString("\n\n") { it.buildString() })
if (filtered.isNotEmpty()) println(filtered.joinToString("\n\n") { it.buildString() })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logger should be used instead of println.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logger should be used instead of println.

Is it possible to suppress the "INFO:" thing that it outputs?

}
}