You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by kamaci <gi...@git.apache.org> on 2017/01/09 19:41:42 UTC

[GitHub] nutch pull request #166: NUTCH-2347 Logger is used instead of printing Throw...

GitHub user kamaci opened a pull request:

    https://github.com/apache/nutch/pull/166

    NUTCH-2347 Logger is used instead of printing Throwable.

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kamaci/nutch NUTCH-2347

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nutch/pull/166.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #166
    
----
commit b5e2a27fe3c10ffa5be176a633edd1daedf008e8
Author: kamaci <fu...@gmail.com>
Date:   2017-01-09T20:41:07Z

    NUTCH-2347 Logger is used instead of printing Throwable.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nutch pull request #166: NUTCH-2347 Logger is used instead of printing Throw...

Posted by sebastian-nagel <gi...@git.apache.org>.
Github user sebastian-nagel commented on a diff in the pull request:

    https://github.com/apache/nutch/pull/166#discussion_r96527045
  
    --- Diff: src/java/org/apache/nutch/parse/ParseUtil.java ---
    @@ -237,7 +237,7 @@ public void processSitemapParse(String url, WebPage page,
               try {
                 reversedUrl = TableUtil.reverseUrl(toUrl); // collect it
               } catch (MalformedURLException e) {
    -            e.printStackTrace();
    +            LOG.error("MalformedURLException occurred: ", e);
    --- End diff --
    
    That a specific exception happened is obvious, would be better to explain what happened with which input, e.g.
    ```
    LOG.error("Failed to reverse URL {}: {}", toUrl, e.getMessage());
    ```
    This also applies to many other of the new log messages. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nutch pull request #166: NUTCH-2347 Logger is used instead of printing Throw...

Posted by kamaci <gi...@git.apache.org>.
Github user kamaci closed the pull request at:

    https://github.com/apache/nutch/pull/166


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nutch pull request #166: NUTCH-2347 Logger is used instead of printing Throw...

Posted by sebastian-nagel <gi...@git.apache.org>.
Github user sebastian-nagel commented on a diff in the pull request:

    https://github.com/apache/nutch/pull/166#discussion_r96527300
  
    --- Diff: src/java/org/apache/nutch/parse/ParseUtil.java ---
    @@ -237,7 +237,7 @@ public void processSitemapParse(String url, WebPage page,
               try {
                 reversedUrl = TableUtil.reverseUrl(toUrl); // collect it
               } catch (MalformedURLException e) {
    -            e.printStackTrace();
    +            LOG.error("MalformedURLException occurred: ", e);
    --- End diff --
    
    Hi @kamaci, thanks. That's of course better than the current state. But at least some messages could be more informative.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---