Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use java.lang.StackWalker if possible #1877

Closed
xuwei-k opened this issue Feb 3, 2023 · 0 comments
Closed

use java.lang.StackWalker if possible #1877

xuwei-k opened this issue Feb 3, 2023 · 0 comments
Labels

Comments

@xuwei-k
Copy link
Member

xuwei-k commented Feb 3, 2023

I think threre are some benefits.

private[this] def stackTraceInformation: String = {
val loggingSQLAndTime =
settingsProvider.loggingSQLAndTime(GlobalSettings.loggingSQLAndTime)
val stackTrace = Thread.currentThread.getStackTrace
val lines = (if (loggingSQLAndTime.printUnprocessedStackTrace) {
stackTrace.tail
} else {
stackTrace.dropWhile { trace =>
val className = trace.getClassName
className != getClass.toString &&
(className.startsWith("java.lang.") || className
.startsWith("scalikejdbc."))
}
}).take(loggingSQLAndTime.stackTraceDepth).map { trace =>
" " + trace.toString
}
" [Stack Trace]" + eol +
" ..." + eol +
lines.mkString(eol) + eol +
" ..." + eol
}

@xuwei-k xuwei-k added the core label Feb 3, 2023
@xuwei-k xuwei-k closed this as not planned Won't fix, can't repro, duplicate, stale Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant