kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: KAFKA-5446: Annoying braces showed on log.error using streams
Date Fri, 16 Jun 2017 23:09:32 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 5b063252e -> 11aa11012


KAFKA-5446: Annoying braces showed on log.error using streams

Fixed log.error usage with annoying braces

Author: ppatierno <ppatierno@live.com>
Author: Paolo Patierno <ppatierno@live.com>

Reviewers: Xavier Léauté, Guozhang Wang

Closes #3338 from ppatierno/log-error


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/11aa1101
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/11aa1101
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/11aa1101

Branch: refs/heads/trunk
Commit: 11aa110126d641cb8f078162fd87bf519ef29766
Parents: 5b06325
Author: Paolo Patierno <ppatierno@live.com>
Authored: Fri Jun 16 16:09:27 2017 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Fri Jun 16 16:09:27 2017 -0700

----------------------------------------------------------------------
 .../internals/ProcessorStateManager.java        |  6 ++---
 .../streams/processor/internals/StreamTask.java |  6 ++---
 .../processor/internals/StreamThread.java       | 28 ++++++++++----------
 3 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/11aa1101/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorStateManager.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorStateManager.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorStateManager.java
index d1bdf95..1a89fab 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorStateManager.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorStateManager.java
@@ -286,7 +286,7 @@ public class ProcessorStateManager implements StateManager {
                         if (firstException == null) {
                             firstException = new ProcessorStateException(String.format("%s
Failed to close state store %s", logPrefix, entry.getKey()), e);
                         }
-                        log.error("{} Failed to close state store {} due to {}", logPrefix,
entry.getKey(), e);
+                        log.error("{} Failed to close state store {}: ", logPrefix, entry.getKey(),
e);
                     }
                 }
 
@@ -303,7 +303,7 @@ public class ProcessorStateManager implements StateManager {
                 if (firstException == null) {
                     firstException = new ProcessorStateException(String.format("%s Failed
to release state dir lock", logPrefix), e);
                 }
-                log.error("{} Failed to release state dir lock due to {}", logPrefix, e);
+                log.error("{} Failed to release state dir lock: ", logPrefix, e);
             }
         }
 
@@ -339,7 +339,7 @@ public class ProcessorStateManager implements StateManager {
             }
             checkpoint.write(checkpointedOffsets);
         } catch (final IOException e) {
-            log.warn("Failed to write checkpoint file to {}", new File(baseDir, CHECKPOINT_FILE_NAME),
e);
+            log.warn("Failed to write checkpoint file to {}:", new File(baseDir, CHECKPOINT_FILE_NAME),
e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/11aa1101/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java
index 09f734b..8355638 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java
@@ -306,7 +306,7 @@ public class StreamTask extends AbstractTask implements Punctuator {
                 try {
                     consumer.commitSync(consumedOffsetsAndMetadata);
                 } catch (final CommitFailedException e) {
-                    log.warn("{} Failed offset commits {} due to {}", logPrefix, consumedOffsetsAndMetadata,
e.getMessage());
+                    log.warn("{} Failed offset commits {}: ", logPrefix, consumedOffsetsAndMetadata,
e);
                     throw e;
                 }
             }
@@ -411,7 +411,7 @@ public class StreamTask extends AbstractTask implements Punctuator {
         } catch (final RuntimeException e) {
             clean = false;
             firstException = e;
-            log.error("{} Could not close task due to {}", logPrefix, e);
+            log.error("{} Could not close task: ", logPrefix, e);
         }
 
         try {
@@ -421,7 +421,7 @@ public class StreamTask extends AbstractTask implements Punctuator {
             if (firstException == null) {
                 firstException = e;
             }
-            log.error("{} Could not close state manager due to {}", logPrefix, e);
+            log.error("{} Could not close state manager: ", logPrefix, e);
         }
 
         try {

http://git-wip-us.apache.org/repos/asf/kafka/blob/11aa1101/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
index ef3d44a..1280f46 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
@@ -260,7 +260,7 @@ public class StreamThread extends Thread {
                     } catch (final LockException e) {
                         // ignore and retry
                         if (!retryingTasks.contains(taskId)) {
-                            log.warn("{} Could not create task {} due to {}. Will retry.",
logPrefix, taskId, e.getMessage());
+                            log.warn("{} Could not create task {}. Will retry: ", logPrefix,
taskId, e);
                             retryingTasks.add(taskId);
                         }
                     }
@@ -532,7 +532,7 @@ public class StreamThread extends Thread {
         } catch (final Exception e) {
             // we have caught all Kafka related exceptions, and other runtime exceptions
             // should be due to user application errors
-            log.error("{} Streams application error during processing: {}", logPrefix, e);
+            log.error("{} Streams application error during processing: ", logPrefix, e);
             throw e;
         } finally {
             shutdown(cleanRun);
@@ -729,7 +729,7 @@ public class StreamThread extends Thread {
                 streamsMetrics.punctuateTimeSensor.record(computeLatency(), timerStartedMs);
             }
         } catch (final KafkaException e) {
-            log.error("{} Failed to punctuate active task {}: {}", logPrefix, task.id(),
e);
+            log.error("{} Failed to punctuate active task {}: ", logPrefix, task.id(), e);
             throw e;
         }
     }
@@ -1045,23 +1045,23 @@ public class StreamThread extends Thread {
             try {
                 threadProducer.close();
             } catch (final Throwable e) {
-                log.error("{} Failed to close producer: {}", logPrefix, e);
+                log.error("{} Failed to close producer: ", logPrefix, e);
             }
         }
         try {
             consumer.close();
         } catch (final Throwable e) {
-            log.error("{} Failed to close consumer: {}", logPrefix, e);
+            log.error("{} Failed to close consumer: ", logPrefix, e);
         }
         try {
             restoreConsumer.close();
         } catch (final Throwable e) {
-            log.error("{} Failed to close restore consumer: {}", logPrefix, e);
+            log.error("{} Failed to close restore consumer: ", logPrefix, e);
         }
         try {
             partitionAssignor.close();
         } catch (final Throwable e) {
-            log.error("{} Failed to close KafkaStreamClient: {}", logPrefix, e);
+            log.error("{} Failed to close KafkaStreamClient: ", logPrefix, e);
         }
 
         removeStreamTasks();
@@ -1085,7 +1085,7 @@ public class StreamThread extends Thread {
             try {
                 task.close(cleanRun);
             } catch (final RuntimeException e) {
-                log.error("{} Failed while closing {} {} due to {}: ",
+                log.error("{} Failed while closing {} {}: ",
                     logPrefix,
                     task.getClass().getSimpleName(),
                     task.id(),
@@ -1142,7 +1142,7 @@ public class StreamThread extends Thread {
             // un-assign the change log partitions
             restoreConsumer.assign(Collections.<TopicPartition>emptyList());
         } catch (final RuntimeException e) {
-            log.error("{} Failed to un-assign change log partitions: {}", logPrefix, e);
+            log.error("{} Failed to un-assign change log partitions: ", logPrefix, e);
             return e;
         }
         return null;
@@ -1198,7 +1198,7 @@ public class StreamThread extends Thread {
                 try {
                     task.close(true);
                 } catch (final Exception e) {
-                    log.error("{} Failed to remove suspended task {}: {}", logPrefix, next.getKey(),
e);
+                    log.error("{} Failed to remove suspended task {}: ", logPrefix, next.getKey(),
e);
                 } finally {
                     suspendedTaskIterator.remove();
                 }
@@ -1217,7 +1217,7 @@ public class StreamThread extends Thread {
                 try {
                     task.close(true);
                 } catch (final Exception e) {
-                    log.error("{} Failed to remove suspended standby task {}: {}", logPrefix,
task.id(), e);
+                    log.error("{} Failed to remove suspended standby task {}: ", logPrefix,
task.id(), e);
                 } finally {
                     standByTaskIterator.remove();
                 }
@@ -1298,7 +1298,7 @@ public class StreamThread extends Thread {
                         newTasks.put(taskId, partitions);
                     }
                 } catch (final StreamsException e) {
-                    log.error("{} Failed to create an active task {}: {}", logPrefix, taskId,
e);
+                    log.error("{} Failed to create an active task {}: ", logPrefix, taskId,
e);
                     throw e;
                 }
             } else {
@@ -1413,7 +1413,7 @@ public class StreamThread extends Thread {
             activeTasks.clear();
             activeTasksByPartition.clear();
         } catch (final Exception e) {
-            log.error("{} Failed to remove stream tasks: {}", logPrefix, e);
+            log.error("{} Failed to remove stream tasks: ", logPrefix, e);
         }
     }
 
@@ -1450,7 +1450,7 @@ public class StreamThread extends Thread {
                 closeZombieTask(task);
                 it.remove();
             } catch (final RuntimeException t) {
-                log.error("{} Failed to {} stream task {} due to: {}",
+                log.error("{} Failed to {} stream task {}: ",
                     logPrefix,
                     action.name(),
                     task.id(),


Mime
View raw message