mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 09:08:04 +01:00
fix: only enable logging for ReVanced
This commit is contained in:
parent
8fb2f2dc1d
commit
783ccf8529
1 changed files with 9 additions and 4 deletions
|
@ -28,6 +28,7 @@ import java.io.Closeable
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.OutputStream
|
import java.io.OutputStream
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
|
import java.util.logging.Level
|
||||||
import java.util.logging.LogManager
|
import java.util.logging.LogManager
|
||||||
|
|
||||||
internal val NAMER = BasicDexFileNamer()
|
internal val NAMER = BasicDexFileNamer()
|
||||||
|
@ -55,10 +56,14 @@ class Patcher(private val options: PatcherOptions) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// Disable unwanted logging.
|
// Disable unwanted logging.
|
||||||
LogManager.getLogManager().let {
|
LogManager.getLogManager().let { manager ->
|
||||||
listOf("app.revanced.apktool-lib", "app.revanced.brut.*").forEach { loggerName ->
|
manager.getLogger("").level = Level.OFF // Disable root logger.
|
||||||
it.getLogger(loggerName)?.useParentHandlers = false
|
// Enable only ReVanced logging.
|
||||||
}
|
manager.loggerNames
|
||||||
|
.toList()
|
||||||
|
.filter { it.startsWith("app.revanced") }
|
||||||
|
.map { manager.getLogger(it) }
|
||||||
|
.forEach { it.level = Level.INFO }
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("Reading dex files")
|
logger.info("Reading dex files")
|
||||||
|
|
Loading…
Reference in a new issue