Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7FD3D19EF8 for ; Sat, 5 Mar 2016 00:09:42 +0000 (UTC) Received: (qmail 33267 invoked by uid 500); 5 Mar 2016 00:09:41 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 33136 invoked by uid 500); 5 Mar 2016 00:09:41 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 32856 invoked by uid 99); 5 Mar 2016 00:09:41 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Mar 2016 00:09:41 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D9FA72C1F6D for ; Sat, 5 Mar 2016 00:09:40 +0000 (UTC) Date: Sat, 5 Mar 2016 00:09:40 +0000 (UTC) From: "Arpit Agarwal (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (HDFS-9817) Use SLF4J in new classes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-9817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15180582#comment-15180582 ] Arpit Agarwal edited comment on HDFS-9817 at 3/5/16 12:09 AM: -------------------------------------------------------------- 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. was (Author: arpitagarwal): 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)