style: rename toStackTrack to dumpToString

This commit is contained in:
2023-09-26 02:33:39 +08:00
parent 68f8b0f571
commit 4d0dce8fd3
2 changed files with 4 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ import android.util.Log
import com.highcapable.yukihookapi.YukiHookAPI
import com.highcapable.yukihookapi.hook.core.api.helper.YukiHookHelper
import com.highcapable.yukihookapi.hook.factory.current
import com.highcapable.yukihookapi.hook.utils.factory.toStackTrace
import com.highcapable.yukihookapi.hook.utils.factory.dumpToString
import com.highcapable.yukihookapi.hook.xposed.bridge.YukiXposedModule
import com.highcapable.yukihookapi.hook.xposed.parasitic.AppParasitics
import java.io.File
@@ -175,7 +175,7 @@ object YukiHookLogger {
content += "${it.head}$it\n"
it.throwable?.also { e ->
content += "${it.head}Dump stack trace for \"${e.current().name}\":\n"
content += e.toStackTrace()
content += e.dumpToString()
}
}
return content

View File

@@ -33,7 +33,7 @@ import java.io.ByteArrayOutputStream
import java.io.PrintStream
/**
* 获取完整的异常堆栈内容
* 写出异常堆栈到字符串
* @return [String]
*/
internal fun Throwable.toStackTrace() = ByteArrayOutputStream().also { printStackTrace(PrintStream(it)) }.toString()
internal fun Throwable.dumpToString() = ByteArrayOutputStream().also { printStackTrace(PrintStream(it)) }.toString()