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

Enis Soztutar commented on HBASE-12341:
---------------------------------------

I did a 5 min google search. 
Seems that we are using commons-logging 1.2 which is the latest version and it 
does not have the lazy string interpolation or Java-8 lambda style. 

Lazy arguments will give us usage like this: 
{code}
      LOG.debug("Found a problem: {} with this {}", arg1, arg2);
{code}

instead of 
{code}
  if (LOG.isDebugEnabled()) {
     LOG.debug("Found a problem:" + arg1 + "with this" + arg2);
  }
{code}

Lambda lazy evaluation would be something like this: 
{code}
  LOG.debug("Result of computing something costly: {}", () -> 
doSomethingCostly()); 
{code}

I don't care too much about lambdas in logging, because there is then the 
overhead of capturing the lambda, although it will lazy execute. 

Then the question is whether moving to log4j2 APIs directly, or moving to slf4j 
first then moving to log4j2 after. We can easily do the two steps 
independently. 

> Overhaul logging; log4j2, machine-readable, etc.
> ------------------------------------------------
>
>                 Key: HBASE-12341
>                 URL: https://issues.apache.org/jira/browse/HBASE-12341
>             Project: HBase
>          Issue Type: Umbrella
>            Reporter: stack
>            Priority: Critical
>             Fix For: 2.0.0
>
>
> This is a general umbrella issue for 2.x logging improvements. Hang related 
> work off this one.



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

Reply via email to