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 Log.getStackTraceString in JULHandle example #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Flowdalic
Copy link
Collaborator

@Flowdalic Flowdalic commented Nov 22, 2014

the previously used implementation to print the stacktrace would only
print the stacktrace of the resulting Exception/Throwable, but the
really relevant stacktrace is the one from the causing
Exception/Throwable. Androids android.util.Log.getStackTraceString()
achieves this by

while (t != null) {
    t = t.getCause();
}

the previously used implementation to print the stacktrace would only
print the stacktrace of the resulting Exception/Throwable, but the
really relevant stacktrace is the one from the causing
Exception/Throwable. Androids android.util.Log.getStackTraceString()
achieves this by

while (t != null) {
    t = t.getCause();
}
@ge0rg
Copy link
Owner

ge0rg commented Dec 3, 2014

I am not quite sure if it is useful to "dig deep" and to follow the chain to the last element, or if we might lose information that way.

If yes, I'd prefer a manual chainwalk to calling an android method, which might have side effects. getStackTraceStringin the master branch for example replaces the stack trace of an UnknownHostException with an empty string. I am not sure which Android releases are affected by this, and I'd rather have the code behave equally on all releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants