Created
January 9, 2020 14:26
-
-
Save olivierperez/d2f8ae52de193f6f948070d7474c19d9 to your computer and use it in GitHub Desktop.
Debug - CallStack
This file contains hidden or 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
fun buildCallStack(): String { | |
return Exception().stackTrace | |
.asSequence() | |
.filter { | |
!it.className.startsWith("fr.o80.corelib") && | |
!it.className.startsWith("io.reactivex") && | |
"rxext" !in it.fileName.toLowerCase(Locale.FRENCH)&& | |
"MyDebuggerClass" !in it.className | |
} | |
.take(4) | |
.fold(StringBuilder()) { acc, it -> | |
acc.append("${it.className}.${it.methodName}(${it.fileName}:${it.lineNumber})") | |
.append(" < ") | |
} | |
.toString() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment