hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-15586) Fix wrong log statements in AbstractService
Date Sat, 07 Jul 2018 14:58:00 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-15586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16535777#comment-16535777

Steve Loughran commented on HADOOP-15586:

* The one in notefailure looks wrong; I think I was intending to just log the exception name
in there, so, that {{+exception}} should be replaced with {{, exception}}

Other changes, -1. We use SLF4J which supports parameterized mesages; the {} entries are expanded
with the toString() calls of every object, downgrading to null if null. This expansion takes
place only if the log is to be printed, so it is much more efficient than any string.format.
See [SLF4J FAQ|https://www.slf4j.org/faq.html].

If you do come across code which still uses string concatenation over expansion, it's old
code from the commons-logging era: when we switched (ongoing!) we changed the imports and
types, but not the actual log statements, just to keep the size of the patches down.

thanks for your submission, let's see what jenkins says. 

> Fix wrong log statements in AbstractService
> -------------------------------------------
>                 Key: HADOOP-15586
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15586
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 2.9.0, 3.1.0
>            Reporter: Szilard Nemeth
>            Assignee: Szilard Nemeth
>            Priority: Minor
>         Attachments: HADOOP-15586-001.patch
> There are some wrong logging statements in AbstractService, here is one example: 
> {code:java}
> LOG.debug("noteFailure {}" + exception);
> {code}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org

View raw message