This repository has been archived by the owner on Apr 15, 2024. It is now read-only.
forked from inotia00/revanced-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Log not showing in CLI (ReVanced#80)
* Fix ReVanced#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
- Loading branch information
Showing
3 changed files
with
20 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/main/kotlin/app/revanced/cli/logging/impl/FlushingStreamHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
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() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters