mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-06-02 11:26:06 +02:00
d9c5a179c5
* 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
13 lines
382 B
Kotlin
13 lines
382 B
Kotlin
package app.revanced.cli.logging.impl
|
|
|
|
import java.io.OutputStream
|
|
import java.util.logging.Formatter
|
|
import java.util.logging.LogRecord
|
|
import java.util.logging.StreamHandler
|
|
|
|
internal class FlushingStreamHandler(out: OutputStream, format: Formatter) : StreamHandler(out, format) {
|
|
override fun publish(record: LogRecord) {
|
|
super.publish(record)
|
|
flush()
|
|
}
|
|
} |