kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch trunk updated: KAFKA-6298; Added support for location aware logger which fixes log line numbers (#4311)
Date Thu, 04 Jan 2018 16:59:58 GMT
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new f459a31  KAFKA-6298; Added support for location aware logger which fixes log line
numbers (#4311)
f459a31 is described below

commit f459a31ccb1271291e148a412463aacbc1b18cc6
Author: Narendra kumar <nknkchoudhary@gmail.com>
AuthorDate: Thu Jan 4 17:59:53 2018 +0100

    KAFKA-6298; Added support for location aware logger which fixes log line numbers (#4311)
    
    LogContext to have two different implementations of Logger. One will be picked based on
availability of LocationAwareLogger API.
    
    Reviewers: Jason Gustafson <jason@confluent.io>
---
 .../org/apache/kafka/common/utils/LogContext.java  | 560 ++++++++++++++++++---
 1 file changed, 484 insertions(+), 76 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/common/utils/LogContext.java b/clients/src/main/java/org/apache/kafka/common/utils/LogContext.java
index 8d34ad0..774961f 100644
--- a/clients/src/main/java/org/apache/kafka/common/utils/LogContext.java
+++ b/clients/src/main/java/org/apache/kafka/common/utils/LogContext.java
@@ -19,6 +19,9 @@ package org.apache.kafka.common.utils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Marker;
+import org.slf4j.helpers.FormattingTuple;
+import org.slf4j.helpers.MessageFormatter;
+import org.slf4j.spi.LocationAwareLogger;
 
 /**
  * This class provides a way to instrument loggers with a common context which can be used
to
@@ -40,20 +43,404 @@ public class LogContext {
     }
 
     public Logger logger(Class<?> clazz) {
-        return new KafkaLogger(clazz, logPrefix);
+        Logger logger = LoggerFactory.getLogger(clazz);
+        if (logger instanceof LocationAwareLogger) {
+            return new LocationAwareKafkaLogger(logPrefix, (LocationAwareLogger) logger);
+        } else {
+            return new LocationIgnorantKafkaLogger(logPrefix, logger);
+        }
     }
 
     public String logPrefix() {
         return logPrefix;
     }
 
-    private static class KafkaLogger implements Logger {
+    private static abstract class AbstractKafkaLogger implements Logger {
+        private final String prefix;
+
+        protected AbstractKafkaLogger(final String prefix) {
+            this.prefix = prefix;
+        }
+
+        protected String addPrefix(final String message) {
+            return prefix + message;
+        }
+    }
+
+    private static class LocationAwareKafkaLogger extends AbstractKafkaLogger {
+        private final LocationAwareLogger logger;
+        private final String fqcn;
+
+        LocationAwareKafkaLogger(String logPrefix, LocationAwareLogger logger) {
+            super(logPrefix);
+            this.logger = logger;
+            this.fqcn = LocationAwareKafkaLogger.class.getName();
+        }
+
+        @Override
+        public String getName() {
+            return logger.getName();
+        }
+
+        @Override
+        public boolean isTraceEnabled() {
+            return logger.isTraceEnabled();
+        }
+
+        @Override
+        public boolean isTraceEnabled(Marker marker) {
+            return logger.isTraceEnabled(marker);
+        }
+
+        @Override
+        public boolean isDebugEnabled() {
+            return logger.isDebugEnabled();
+        }
+
+        @Override
+        public boolean isDebugEnabled(Marker marker) {
+            return logger.isDebugEnabled(marker);
+        }
+
+        @Override
+        public boolean isInfoEnabled() {
+            return logger.isInfoEnabled();
+        }
+
+        @Override
+        public boolean isInfoEnabled(Marker marker) {
+            return logger.isInfoEnabled(marker);
+        }
+
+        @Override
+        public boolean isWarnEnabled() {
+            return logger.isWarnEnabled();
+        }
+
+        @Override
+        public boolean isWarnEnabled(Marker marker) {
+            return logger.isWarnEnabled(marker);
+        }
+
+        @Override
+        public boolean isErrorEnabled() {
+            return logger.isErrorEnabled();
+        }
+
+        @Override
+        public boolean isErrorEnabled(Marker marker) {
+            return logger.isErrorEnabled(marker);
+        }
+
+        @Override
+        public void trace(String message) {
+            if (logger.isTraceEnabled()) {
+                writeLog(null, LocationAwareLogger.TRACE_INT, message, null, null);
+            }
+        }
+
+        @Override
+        public void trace(String format, Object arg) {
+            if (logger.isTraceEnabled()) {
+                writeLog(null, LocationAwareLogger.TRACE_INT, format, new Object[]{arg},
null);
+            }
+        }
+
+        @Override
+        public void trace(String format, Object arg1, Object arg2) {
+            if (logger.isTraceEnabled()) {
+                writeLog(null, LocationAwareLogger.TRACE_INT, format, new Object[]{arg1,
arg2}, null);
+            }
+        }
+
+        @Override
+        public void trace(String format, Object... args) {
+            if (logger.isTraceEnabled()) {
+                writeLog(null, LocationAwareLogger.TRACE_INT, format, args, null);
+            }
+        }
+
+        @Override
+        public void trace(String msg, Throwable t) {
+            if (logger.isTraceEnabled()) {
+                writeLog(null, LocationAwareLogger.TRACE_INT, msg, null, t);
+            }
+        }
+
+        @Override
+        public void trace(Marker marker, String msg) {
+            if (logger.isTraceEnabled()) {
+                writeLog(marker, LocationAwareLogger.TRACE_INT, msg, null, null);
+            }
+        }
+
+        @Override
+        public void trace(Marker marker, String format, Object arg) {
+            if (logger.isTraceEnabled()) {
+                writeLog(marker, LocationAwareLogger.TRACE_INT, format, new Object[]{arg},
null);
+            }
+        }
+
+        @Override
+        public void trace(Marker marker, String format, Object arg1, Object arg2) {
+            if (logger.isTraceEnabled()) {
+                writeLog(marker, LocationAwareLogger.TRACE_INT, format, new Object[]{arg1,
arg2}, null);
+            }
+        }
+
+        @Override
+        public void trace(Marker marker, String format, Object... argArray) {
+            if (logger.isTraceEnabled()) {
+                writeLog(marker, LocationAwareLogger.TRACE_INT, format, argArray, null);
+            }
+        }
+
+        @Override
+        public void trace(Marker marker, String msg, Throwable t) {
+            if (logger.isTraceEnabled()) {
+                writeLog(marker, LocationAwareLogger.TRACE_INT, msg, null, t);
+            }
+        }
+
+        @Override
+        public void debug(String message) {
+            if (logger.isDebugEnabled()) {
+                writeLog(null, LocationAwareLogger.DEBUG_INT, message, null, null);
+            }
+        }
+
+        @Override
+        public void debug(String format, Object arg) {
+            if (logger.isDebugEnabled()) {
+                writeLog(null, LocationAwareLogger.DEBUG_INT, format, new Object[]{arg},
null);
+            }
+        }
+
+        @Override
+        public void debug(String format, Object arg1, Object arg2) {
+            if (logger.isDebugEnabled()) {
+                writeLog(null, LocationAwareLogger.DEBUG_INT, format, new Object[]{arg1,
arg2}, null);
+            }
+        }
+
+        @Override
+        public void debug(String format, Object... args) {
+            if (logger.isDebugEnabled()) {
+                writeLog(null, LocationAwareLogger.DEBUG_INT, format, args, null);
+            }
+        }
+
+        @Override
+        public void debug(String msg, Throwable t) {
+            if (logger.isDebugEnabled()) {
+                writeLog(null, LocationAwareLogger.DEBUG_INT, msg, null, t);
+            }
+        }
+
+        @Override
+        public void debug(Marker marker, String msg) {
+            if (logger.isDebugEnabled()) {
+                writeLog(marker, LocationAwareLogger.DEBUG_INT, msg, null, null);
+            }
+        }
+
+        @Override
+        public void debug(Marker marker, String format, Object arg) {
+            if (logger.isDebugEnabled()) {
+                writeLog(marker, LocationAwareLogger.DEBUG_INT, format, new Object[]{arg},
null);
+            }
+        }
+
+        @Override
+        public void debug(Marker marker, String format, Object arg1, Object arg2) {
+            if (logger.isDebugEnabled()) {
+                writeLog(marker, LocationAwareLogger.DEBUG_INT, format, new Object[]{arg1,
arg2}, null);
+            }
+        }
+
+        @Override
+        public void debug(Marker marker, String format, Object... arguments) {
+            if (logger.isDebugEnabled()) {
+                writeLog(marker, LocationAwareLogger.DEBUG_INT, format, arguments, null);
+            }
+        }
+
+        @Override
+        public void debug(Marker marker, String msg, Throwable t) {
+            if (logger.isDebugEnabled()) {
+                writeLog(marker, LocationAwareLogger.DEBUG_INT, msg, null, t);
+            }
+        }
+
+        @Override
+        public void warn(String message) {
+            writeLog(null, LocationAwareLogger.WARN_INT, message, null, null);
+        }
+
+        @Override
+        public void warn(String format, Object arg) {
+            writeLog(null, LocationAwareLogger.WARN_INT, format, new Object[]{arg}, null);
+        }
+
+        @Override
+        public void warn(String message, Object arg1, Object arg2) {
+            writeLog(null, LocationAwareLogger.WARN_INT, message, new Object[]{arg1, arg2},
null);
+        }
+
+        @Override
+        public void warn(String format, Object... args) {
+            writeLog(null, LocationAwareLogger.WARN_INT, format, args, null);
+        }
+
+        @Override
+        public void warn(String msg, Throwable t) {
+            writeLog(null, LocationAwareLogger.WARN_INT, msg, null, t);
+        }
+
+        @Override
+        public void warn(Marker marker, String msg) {
+            writeLog(marker, LocationAwareLogger.WARN_INT, msg, null, null);
+        }
+
+        @Override
+        public void warn(Marker marker, String format, Object arg) {
+            writeLog(marker, LocationAwareLogger.WARN_INT, format, new Object[]{arg}, null);
+        }
+
+        @Override
+        public void warn(Marker marker, String format, Object arg1, Object arg2) {
+            writeLog(marker, LocationAwareLogger.WARN_INT, format, new Object[]{arg1, arg2},
null);
+        }
+
+        @Override
+        public void warn(Marker marker, String format, Object... arguments) {
+            writeLog(marker, LocationAwareLogger.WARN_INT, format, arguments, null);
+        }
+
+        @Override
+        public void warn(Marker marker, String msg, Throwable t) {
+            writeLog(marker, LocationAwareLogger.WARN_INT, msg, null, t);
+        }
+
+        @Override
+        public void error(String message) {
+            writeLog(null, LocationAwareLogger.ERROR_INT, message, null, null);
+        }
+
+        @Override
+        public void error(String format, Object arg) {
+            writeLog(null, LocationAwareLogger.ERROR_INT, format, new Object[]{arg}, null);
+        }
+
+        @Override
+        public void error(String format, Object arg1, Object arg2) {
+            writeLog(null, LocationAwareLogger.ERROR_INT, format, new Object[]{arg1, arg2},
null);
+        }
+
+        @Override
+        public void error(String format, Object... args) {
+            writeLog(null, LocationAwareLogger.ERROR_INT, format, args, null);
+        }
+
+        @Override
+        public void error(String msg, Throwable t) {
+            writeLog(null, LocationAwareLogger.ERROR_INT, msg, null, t);
+        }
+
+        @Override
+        public void error(Marker marker, String msg) {
+            writeLog(marker, LocationAwareLogger.ERROR_INT, msg, null, null);
+        }
+
+        @Override
+        public void error(Marker marker, String format, Object arg) {
+            writeLog(marker, LocationAwareLogger.ERROR_INT, format, new Object[]{arg}, null);
+        }
+
+        @Override
+        public void error(Marker marker, String format, Object arg1, Object arg2) {
+            writeLog(marker, LocationAwareLogger.ERROR_INT, format, new Object[]{arg1, arg2},
null);
+        }
+
+        @Override
+        public void error(Marker marker, String format, Object... arguments) {
+            writeLog(marker, LocationAwareLogger.ERROR_INT, format, arguments, null);
+        }
+
+        @Override
+        public void error(Marker marker, String msg, Throwable t) {
+            writeLog(marker, LocationAwareLogger.ERROR_INT, msg, null, t);
+        }
+
+        @Override
+        public void info(String msg) {
+            writeLog(null, LocationAwareLogger.INFO_INT, msg, null, null);
+        }
+
+        @Override
+        public void info(String format, Object arg) {
+            writeLog(null, LocationAwareLogger.INFO_INT, format, new Object[]{arg}, null);
+        }
+
+        @Override
+        public void info(String format, Object arg1, Object arg2) {
+            writeLog(null, LocationAwareLogger.INFO_INT, format, new Object[]{arg1, arg2},
null);
+        }
+
+        @Override
+        public void info(String format, Object... args) {
+            writeLog(null, LocationAwareLogger.INFO_INT, format, args, null);
+        }
+
+        @Override
+        public void info(String msg, Throwable t) {
+            writeLog(null, LocationAwareLogger.INFO_INT, msg, null, t);
+        }
+
+        @Override
+        public void info(Marker marker, String msg) {
+            writeLog(marker, LocationAwareLogger.INFO_INT, msg, null, null);
+        }
+
+        @Override
+        public void info(Marker marker, String format, Object arg) {
+            writeLog(marker, LocationAwareLogger.INFO_INT, format, new Object[]{arg}, null);
+        }
+
+        @Override
+        public void info(Marker marker, String format, Object arg1, Object arg2) {
+            writeLog(marker, LocationAwareLogger.INFO_INT, format, new Object[]{arg1, arg2},
null);
+        }
+
+        @Override
+        public void info(Marker marker, String format, Object... arguments) {
+            writeLog(marker, LocationAwareLogger.INFO_INT, format, arguments, null);
+        }
+
+        @Override
+        public void info(Marker marker, String msg, Throwable t) {
+            writeLog(marker, LocationAwareLogger.INFO_INT, msg, null, t);
+        }
+
+        private void writeLog(Marker marker, int level, String format, Object[] args, Throwable
exception) {
+            String message = format;
+            if (args != null && args.length > 0) {
+                FormattingTuple formatted = MessageFormatter.arrayFormat(format, args);
+                if (exception == null && formatted.getThrowable() != null) {
+                    exception = formatted.getThrowable();
+                }
+                message = formatted.getMessage();
+            }
+            logger.log(marker, fqcn, level, addPrefix(message), null, exception);
+        }
+    }
+
+    private static class LocationIgnorantKafkaLogger extends AbstractKafkaLogger {
         private final Logger logger;
-        private final String logPrefix;
 
-        public KafkaLogger(Class<?> clazz, String logPrefix) {
-            this.logger = LoggerFactory.getLogger(clazz);
-            this.logPrefix = logPrefix;
+        LocationIgnorantKafkaLogger(String logPrefix, Logger logger) {
+            super(logPrefix);
+            this.logger = logger;
         }
 
         @Override
@@ -113,273 +500,294 @@ public class LogContext {
 
         @Override
         public void trace(String message) {
-            if (logger.isTraceEnabled())
-                logger.trace(logPrefix + message);
+            if (logger.isTraceEnabled()) {
+                logger.trace(addPrefix(message));
+            }
         }
 
         @Override
         public void trace(String message, Object arg) {
-            if (logger.isTraceEnabled())
-                logger.trace(logPrefix + message, arg);
+            if (logger.isTraceEnabled()) {
+                logger.trace(addPrefix(message), arg);
+            }
         }
 
         @Override
         public void trace(String message, Object arg1, Object arg2) {
-            if (logger.isTraceEnabled())
-                logger.trace(logPrefix + message, arg1, arg2);
+            if (logger.isTraceEnabled()) {
+                logger.trace(addPrefix(message), arg1, arg2);
+            }
         }
 
         @Override
         public void trace(String message, Object... args) {
-            if (logger.isTraceEnabled())
-                logger.trace(logPrefix + message, args);
+            if (logger.isTraceEnabled()) {
+                logger.trace(addPrefix(message), args);
+            }
         }
 
         @Override
         public void trace(String msg, Throwable t) {
-            if (logger.isTraceEnabled())
-                logger.trace(logPrefix + msg, t);
+            if (logger.isTraceEnabled()) {
+                logger.trace(addPrefix(msg), t);
+            }
         }
 
         @Override
         public void trace(Marker marker, String msg) {
-            if (logger.isTraceEnabled())
-                logger.trace(marker, logPrefix + msg);
+            if (logger.isTraceEnabled()) {
+                logger.trace(marker, addPrefix(msg));
+            }
         }
 
         @Override
         public void trace(Marker marker, String format, Object arg) {
-            if (logger.isTraceEnabled())
-                logger.trace(marker, logPrefix + format, arg);
+            if (logger.isTraceEnabled()) {
+                logger.trace(marker, addPrefix(format), arg);
+            }
         }
 
         @Override
         public void trace(Marker marker, String format, Object arg1, Object arg2) {
-            if (logger.isTraceEnabled())
-                logger.trace(marker, logPrefix + format, arg1, arg2);
+            if (logger.isTraceEnabled()) {
+                logger.trace(marker, addPrefix(format), arg1, arg2);
+            }
         }
 
         @Override
         public void trace(Marker marker, String format, Object... argArray) {
-            if (logger.isTraceEnabled())
-                logger.trace(marker, logPrefix + format, argArray);
+            if (logger.isTraceEnabled()) {
+                logger.trace(marker, addPrefix(format), argArray);
+            }
         }
 
         @Override
         public void trace(Marker marker, String msg, Throwable t) {
-            if (logger.isTraceEnabled())
-                logger.trace(marker, logPrefix + msg, t);
+            if (logger.isTraceEnabled()) {
+                logger.trace(marker, addPrefix(msg), t);
+            }
         }
 
         @Override
         public void debug(String message) {
-            if (logger.isDebugEnabled())
-                logger.debug(logPrefix + message);
+            if (logger.isDebugEnabled()) {
+                logger.debug(addPrefix(message));
+            }
         }
 
         @Override
         public void debug(String message, Object arg) {
-            if (logger.isDebugEnabled())
-                logger.debug(logPrefix + message, arg);
+            if (logger.isDebugEnabled()) {
+                logger.debug(addPrefix(message), arg);
+            }
         }
 
         @Override
         public void debug(String message, Object arg1, Object arg2) {
-            if (logger.isDebugEnabled())
-                logger.debug(logPrefix + message, arg1, arg2);
+            if (logger.isDebugEnabled()) {
+                logger.debug(addPrefix(message), arg1, arg2);
+            }
         }
 
         @Override
         public void debug(String message, Object... args) {
-            if (logger.isDebugEnabled())
-                logger.debug(logPrefix + message, args);
+            if (logger.isDebugEnabled()) {
+                logger.debug(addPrefix(message), args);
+            }
         }
 
         @Override
         public void debug(String msg, Throwable t) {
-            if (logger.isDebugEnabled())
-                logger.debug(logPrefix + msg, t);
+            if (logger.isDebugEnabled()) {
+                logger.debug(addPrefix(msg), t);
+            }
         }
 
         @Override
         public void debug(Marker marker, String msg) {
-            if (logger.isDebugEnabled())
-                logger.debug(marker, logPrefix + msg);
+            if (logger.isDebugEnabled()) {
+                logger.debug(marker, addPrefix(msg));
+            }
         }
 
         @Override
         public void debug(Marker marker, String format, Object arg) {
-            if (logger.isDebugEnabled())
-                logger.debug(marker, logPrefix + format, arg);
+            if (logger.isDebugEnabled()) {
+                logger.debug(marker, addPrefix(format), arg);
+            }
         }
 
         @Override
         public void debug(Marker marker, String format, Object arg1, Object arg2) {
-            if (logger.isDebugEnabled())
-                logger.debug(marker, logPrefix + format, arg1, arg2);
+            if (logger.isDebugEnabled()) {
+                logger.debug(marker, addPrefix(format), arg1, arg2);
+            }
         }
 
         @Override
         public void debug(Marker marker, String format, Object... arguments) {
-            if (logger.isDebugEnabled())
-                logger.debug(marker, logPrefix + format, arguments);
+            if (logger.isDebugEnabled()) {
+                logger.debug(marker, addPrefix(format), arguments);
+            }
         }
 
         @Override
         public void debug(Marker marker, String msg, Throwable t) {
-            if (logger.isDebugEnabled())
-                logger.debug(marker, logPrefix + msg, t);
+            if (logger.isDebugEnabled()) {
+                logger.debug(marker, addPrefix(msg), t);
+            }
         }
 
         @Override
         public void warn(String message) {
-            logger.warn(logPrefix + message);
+            logger.warn(addPrefix(message));
         }
 
         @Override
         public void warn(String message, Object arg) {
-            logger.warn(logPrefix + message, arg);
+            logger.warn(addPrefix(message), arg);
         }
 
         @Override
         public void warn(String message, Object arg1, Object arg2) {
-            logger.warn(logPrefix + message, arg1, arg2);
+            logger.warn(addPrefix(message), arg1, arg2);
         }
 
         @Override
         public void warn(String message, Object... args) {
-            logger.warn(logPrefix + message, args);
+            logger.warn(addPrefix(message), args);
         }
 
         @Override
         public void warn(String msg, Throwable t) {
-            logger.warn(logPrefix + msg, t);
+            logger.warn(addPrefix(msg), t);
         }
 
         @Override
         public void warn(Marker marker, String msg) {
-            logger.warn(marker, logPrefix + msg);
+            logger.warn(marker, addPrefix(msg));
         }
 
         @Override
         public void warn(Marker marker, String format, Object arg) {
-            logger.warn(marker, logPrefix + format, arg);
+            logger.warn(marker, addPrefix(format), arg);
         }
 
         @Override
         public void warn(Marker marker, String format, Object arg1, Object arg2) {
-            logger.warn(marker, logPrefix + format, arg1, arg2);
+            logger.warn(marker, addPrefix(format), arg1, arg2);
         }
 
         @Override
         public void warn(Marker marker, String format, Object... arguments) {
-            logger.warn(marker, logPrefix + format, arguments);
+            logger.warn(marker, addPrefix(format), arguments);
         }
 
         @Override
         public void warn(Marker marker, String msg, Throwable t) {
-            logger.warn(marker, logPrefix + msg, t);
+            logger.warn(marker, addPrefix(msg), t);
         }
 
         @Override
         public void error(String message) {
-            logger.error(logPrefix + message);
+            logger.error(addPrefix(message));
         }
 
         @Override
         public void error(String message, Object arg) {
-            logger.error(logPrefix + message, arg);
+            logger.error(addPrefix(message), arg);
         }
 
         @Override
         public void error(String message, Object arg1, Object arg2) {
-            logger.error(logPrefix + message, arg1, arg2);
+            logger.error(addPrefix(message), arg1, arg2);
         }
 
         @Override
         public void error(String message, Object... args) {
-            logger.error(logPrefix + message, args);
+            logger.error(addPrefix(message), args);
         }
 
         @Override
         public void error(String msg, Throwable t) {
-            logger.error(logPrefix + msg, t);
+            logger.error(addPrefix(msg), t);
         }
 
         @Override
         public void error(Marker marker, String msg) {
-            logger.error(marker, logPrefix + msg);
+            logger.error(marker, addPrefix(msg));
         }
 
         @Override
         public void error(Marker marker, String format, Object arg) {
-            logger.error(marker, logPrefix + format, arg);
+            logger.error(marker, addPrefix(format), arg);
         }
 
         @Override
         public void error(Marker marker, String format, Object arg1, Object arg2) {
-            logger.error(marker, logPrefix + format, arg1, arg2);
+            logger.error(marker, addPrefix(format), arg1, arg2);
         }
 
         @Override
         public void error(Marker marker, String format, Object... arguments) {
-            logger.error(marker, logPrefix + format, arguments);
+            logger.error(marker, addPrefix(format), arguments);
         }
 
         @Override
         public void error(Marker marker, String msg, Throwable t) {
-            logger.error(marker, logPrefix + msg, t);
+            logger.error(marker, addPrefix(msg), t);
         }
 
         @Override
         public void info(String message) {
-            logger.info(logPrefix + message);
+            logger.info(addPrefix(message));
         }
 
         @Override
         public void info(String message, Object arg) {
-            logger.info(logPrefix + message, arg);
+            logger.info(addPrefix(message), arg);
         }
 
         @Override
         public void info(String message, Object arg1, Object arg2) {
-            logger.info(logPrefix + message, arg1, arg2);
+            logger.info(addPrefix(message), arg1, arg2);
         }
 
         @Override
         public void info(String message, Object... args) {
-            logger.info(logPrefix + message, args);
+            logger.info(addPrefix(message), args);
         }
 
         @Override
         public void info(String msg, Throwable t) {
-            logger.info(logPrefix + msg, t);
+            logger.info(addPrefix(msg), t);
         }
 
         @Override
         public void info(Marker marker, String msg) {
-            logger.info(marker, logPrefix + msg);
+            logger.info(marker, addPrefix(msg));
         }
 
         @Override
         public void info(Marker marker, String format, Object arg) {
-            logger.info(marker, logPrefix + format, arg);
+            logger.info(marker, addPrefix(format), arg);
         }
 
         @Override
         public void info(Marker marker, String format, Object arg1, Object arg2) {
-            logger.info(marker, logPrefix + format, arg1, arg2);
+            logger.info(marker, addPrefix(format), arg1, arg2);
         }
 
         @Override
         public void info(Marker marker, String format, Object... arguments) {
-            logger.info(marker, logPrefix + format, arguments);
+            logger.info(marker, addPrefix(format), arguments);
         }
 
         @Override
         public void info(Marker marker, String msg, Throwable t) {
-            logger.info(marker, logPrefix + msg, t);
+            logger.info(marker, addPrefix(msg), t);
         }
 
     }
+
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@kafka.apache.org" <commits@kafka.apache.org>'].

Mime
View raw message