hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tsz Wo (Nicholas), SZE (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-6884) Add LOG.isDebugEnabled() guard for each LOG.debug("...")
Date Tue, 17 Aug 2010 16:43:17 GMT

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

Tsz Wo (Nicholas), SZE commented on HADOOP-6884:

For aspectj, first of all, we currently don't use aspectj in Hadoop except for testing.  I
beg there are people against using aspectj or other byte-code rewriting technique on the non-testing
codes since it is hard to debug.

Let's be academic (as what I see in this issue) and ignore the statement above.  I cannot
see a simple solution on using aspectj.  Clearly, if we define a point cut per LOG.debug(..),
aspectj will works but this is too much of works and, in some cases, we need to change the
codes in order to define a point cut.  For the people suggesting aspectj and saying that it
is simple, could you please provide a simple example?

I heard one suggestion from Luke yesterday.  He claimed we could use the "around" advice.
 However, it seems to me that around does not prevent parameter evaluation.  I have not tested
it yet.

> Add LOG.isDebugEnabled() guard for each LOG.debug("...")
> --------------------------------------------------------
>                 Key: HADOOP-6884
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6884
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Erik Steffl
>            Assignee: Erik Steffl
>             Fix For: 0.22.0
>         Attachments: HADOOP-6884-0.22-1.patch, HADOOP-6884-0.22.patch
> Each LOG.debug("...") should be executed only if LOG.isDebugEnabled() is true, in some
cases it's expensive to construct the string that is being printed to log. It's much easier
to always use LOG.isDebugEnabled() because it's easier to check (rather than in each case
reason whether it's necessary or not).

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message