hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arpit Agarwal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-9817) Use SLF4J in new classes
Date Fri, 04 Mar 2016 21:40:41 GMT

    [ https://issues.apache.org/jira/browse/HDFS-9817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15180582#comment-15180582
] 

Arpit Agarwal commented on HDFS-9817:
-------------------------------------

Thanks for addressing this [~anu]. One minor comment.

When calling LOG.debug with SLF4J we prefer to use the curly brace {{\{\}}} notation to pass
arguments. This avoids the cost of string formatting when debug logging is disabled which
is the normal configuration.

So this,
{code}
LOG.debug("Cluster URI : " + clusterURI);
{code}

Would be written as
{code}
LOG.debug("Cluster URI : {}", clusterURI);
{code}

+1 otherwise.

> Use SLF4J in new classes
> ------------------------
>
>                 Key: HDFS-9817
>                 URL: https://issues.apache.org/jira/browse/HDFS-9817
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: logging
>    Affects Versions: HDFS-1312
>            Reporter: Arpit Agarwal
>            Assignee: Anu Engineer
>         Attachments: HDFS-9817-HDFS-1312.001.patch
>
>
> We are trying to use SLF4J for new classes as far as possible so let's change all the
newly added classes to use SLF4J instead of depending on Log4J.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message