[
https://issues.apache.org/jira/browse/HDFS-7978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14377302#comment-14377302
]
Walter Su commented on HDFS-7978:
---------------------------------
Thanks [~andrew.wang]] for comments.
1. I know little about slf4j, and I looked it. I found that the usage pattern
has little different. We need to call something like
{{logger.debug(arg1,arg2..)}} .
2. I wrapped something like {{LOG.debug(this +...)}} , So If you look at
{{FileJournalManager.toString()}}, {{Token.toString()}}, {{URI.toString()}},
You will find out they are a bit expensive.
> Add LOG.isDebugEnabled() guard for some LOG.debug(..)
> -----------------------------------------------------
>
> Key: HDFS-7978
> URL: https://issues.apache.org/jira/browse/HDFS-7978
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: Walter Su
> Assignee: Walter Su
> Attachments: HDFS-7978.001.patch
>
>
> {{isDebugEnabled()}} is optional. But when there are :
> 1. lots of concatenating Strings
> 2. complicated function calls
> in the arguments, {{LOG.debug(..)}} should be guarded with
> {{LOG.isDebugEnabled()}} to avoid unnecessary arguments evaluation and impove
> performance.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)