revanced-cli/src/main/kotlin/app/revanced/cli/patcher/logging/impl/PatcherLogger.kt
EdgE790 d9c5a179c5
fix: Log not showing in CLI (#80)
* Fix #79. Changed from default StreamHandler to FlushingStreamHandler which flushes after every log statement

* Added removal of handlers, so they will not be duplicated.

* Replaced removal of handlers with addition only in case if there are no handlers already.
Changed errorLogger name from hardcoded to reusing previous logger name, so it will have the same name if only first parameter is used.

* Replaced calls ::javaClass.name to ::class.java.name to have proper class names in loggers
2022-07-11 14:25:17 +02:00

13 lines
530 B
Kotlin

package app.revanced.cli.patcher.logging.impl
import app.revanced.cli.logging.impl.DefaultCliLogger
import java.util.logging.Logger
internal object PatcherLogger : app.revanced.patcher.logging.Logger{
private val logger = DefaultCliLogger(Logger.getLogger(app.revanced.patcher.Patcher::class.java.name))
override fun error(msg: String) = logger.error(msg)
override fun info(msg: String) = logger.info(msg)
override fun warn(msg: String)= logger.warn(msg)
override fun trace(msg: String)= logger.trace(msg)
}