FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Replacing calls to `Exception#printStackTrace()` with Java logging. by benjamin-bader · Pull Request #139 · msgpack/msgpack-java · GitHub

Replacing calls to Exception#printStackTrace() with Java logging. - #139

Merged
komamitsu merged 3 commits into
msgpack:masterfrom
benjamin-bader:no-exception-printing
Dec 7, 2014
Merged

Replacing calls to Exception#printStackTrace() with Java logging.#139
komamitsu merged 3 commits into
msgpack:masterfrom
benjamin-bader:no-exception-printing

Conversation

Copy link
Copy Markdown

This will keep output cleaner, especially in Android where logging and stdout are mixed.

This will keep output cleaner, especially in Android where logging and stdout are mixed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm puzzled by this formatting; the file itself seems to have proper indentation. Perhaps my local git configuration is to blame...

oza commented Oct 2, 2014

Copy link
Copy Markdown
Member

Thanks for your contribution, @benjamin-bader. It looks good to me. @komamitsu, could you check this issue?

Copy link
Copy Markdown
Member

@benjamin-bader I noticed that the original e.printStackTrace() is outputted regardless of the log level. But in your change, the stack trace is hidden if the log level is more than FINE.

Also, we can output the stack trace of a Throwable using java.util.logging.Logger#log(java.util.logging.Level, java.lang.String, java.lang.Throwable). So maybe we don't need to create org.msgpack.util.Exceptions.

Originally, that error message is important and I think we should've outputted it as a higher log level with its stack trace...

After all, something like the following code seems better to me. What do you think?

    } catch (SecurityException e) {
        LOG.log(Level.WARNING, "Cannot append a search path of classloader", e);

Copy link
Copy Markdown
Author

@komamitsu Sounds good, thank you for the feedback. I'll fix and update today.

Additionaly, increase log level of exceptions from FINE to WARNING.
komamitsu added a commit that referenced this pull request Dec 7, 2014
Replacing calls to `Exception#printStackTrace()` with Java logging.
komamitsu merged commit 8461d9d into msgpack:master Dec 7, 2014

Copy link
Copy Markdown
Member

@benjamin-bader Sorry for my delay and thanks for your contribution!

Copy link
Copy Markdown
Author

Thank you @komamitsu! I had assumed this section of the codebase was obsolete in the upcoming 0.7 release - glad to hear that this may still be useful.

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
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.

3 participants


Back | FazBrowse Home | New Git URL