Fix Ansi Pollution (#596)

This commit is contained in:
Karlatemp 2020-09-15 19:29:27 +08:00 committed by GitHub
parent 152709a0f1
commit 8d0fd96a22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,7 +59,7 @@ public actual open class PlatformLogger @JvmOverloads constructor(
*/
@SinceMirai("1.1.0")
protected open fun printLog(message: String?, priority: SimpleLogger.LogPriority) {
if (isColored) output("${priority.color}$currentTimeFormatted ${priority.simpleName}/$identity: $message")
if (isColored) output("${priority.color}$currentTimeFormatted ${priority.simpleName}/$identity: $message${Color.RESET}")
else output("$currentTimeFormatted ${priority.simpleName}/$identity: $message")
}
@ -143,4 +143,4 @@ internal val Throwable.stackTraceString
get() = ByteArrayOutputStream().run {
printStackTrace(PrintStream(this))
String(this.toByteArray())
}
}