cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject cassandra git commit: use parameterized logging
Date Thu, 23 Jun 2016 05:37:06 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk bf3255fc9 -> f147ca91c


use parameterized logging


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

Branch: refs/heads/trunk
Commit: f147ca91c759b8013c5226774bc974c342bee3f0
Parents: bf3255f
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Thu Jun 23 01:35:43 2016 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Thu Jun 23 01:36:23 2016 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/config/Config.java                 | 2 +-
 .../org/apache/cassandra/db/WindowsFailedSnapshotTracker.java    | 3 +--
 src/java/org/apache/cassandra/dht/RangeStreamer.java             | 4 ++--
 .../org/apache/cassandra/dht/tokenallocator/TokenAllocation.java | 4 ++--
 src/java/org/apache/cassandra/io/util/FileUtils.java             | 2 +-
 src/java/org/apache/cassandra/service/StartupChecks.java         | 2 +-
 src/java/org/apache/cassandra/utils/WindowsTimer.java            | 4 ++--
 7 files changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f147ca91/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index c18d1e0..2473c0c 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -459,6 +459,6 @@ public class Config
             configMap.put(name, value);
         }
 
-        logger.info("Node configuration:[" + Joiner.on("; ").join(configMap.entrySet()) +
"]");
+        logger.info("Node configuration:[{}]", Joiner.on("; ").join(configMap.entrySet()));
     }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f147ca91/src/java/org/apache/cassandra/db/WindowsFailedSnapshotTracker.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/WindowsFailedSnapshotTracker.java b/src/java/org/apache/cassandra/db/WindowsFailedSnapshotTracker.java
index 7cc7893..134fb11 100644
--- a/src/java/org/apache/cassandra/db/WindowsFailedSnapshotTracker.java
+++ b/src/java/org/apache/cassandra/db/WindowsFailedSnapshotTracker.java
@@ -85,8 +85,7 @@ public class WindowsFailedSnapshotTracker
             }
             catch (IOException e)
             {
-                logger.warn("Failed to open {}. Obsolete snapshots from previous runs will
not be deleted.", TODELETEFILE);
-                logger.warn("Exception: " + e);
+                logger.warn("Failed to open {}. Obsolete snapshots from previous runs will
not be deleted.", TODELETEFILE, e);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f147ca91/src/java/org/apache/cassandra/dht/RangeStreamer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/dht/RangeStreamer.java b/src/java/org/apache/cassandra/dht/RangeStreamer.java
index 8265e2b..ee2d792 100644
--- a/src/java/org/apache/cassandra/dht/RangeStreamer.java
+++ b/src/java/org/apache/cassandra/dht/RangeStreamer.java
@@ -326,8 +326,8 @@ public class RangeStreamer
                         throw new IllegalStateException("Unable to find sufficient sources
for streaming range " + range + " in keyspace " + keyspace + " with RF=1." +
                                                         "If you want to ignore this, consider
using system property -Dcassandra.consistent.rangemovement=false.");
                     else
-                        logger.warn("Unable to find sufficient sources for streaming range
" + range + " in keyspace " + keyspace + " with RF=1. " +
-                                    "Keyspace might be missing data.");
+                        logger.warn("Unable to find sufficient sources for streaming range
{} in keyspace {} with RF=1. " +
+                                    "Keyspace might be missing data.", range, keyspace);
                 }
                 else
                     throw new IllegalStateException("Unable to find sufficient sources for
streaming range " + range + " in keyspace " + keyspace);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f147ca91/src/java/org/apache/cassandra/dht/tokenallocator/TokenAllocation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/dht/tokenallocator/TokenAllocation.java b/src/java/org/apache/cassandra/dht/tokenallocator/TokenAllocation.java
index e715ff6..7658ea0 100644
--- a/src/java/org/apache/cassandra/dht/tokenallocator/TokenAllocation.java
+++ b/src/java/org/apache/cassandra/dht/tokenallocator/TokenAllocation.java
@@ -62,8 +62,8 @@ public class TokenAllocation
             TokenMetadata tokenMetadataCopy = tokenMetadata.cloneOnlyTokenMap();
             tokenMetadataCopy.updateNormalTokens(tokens, endpoint);
             SummaryStatistics ns = replicatedOwnershipStats(tokenMetadataCopy, rs, endpoint);
-            logger.warn("Replicated node load in datacentre before allocation " + statToString(os));
-            logger.warn("Replicated node load in datacentre after allocation " + statToString(ns));
+            logger.warn("Replicated node load in datacentre before allocation {}", statToString(os));
+            logger.warn("Replicated node load in datacentre after allocation {}", statToString(ns));
 
             // TODO: Is it worth doing the replicated ownership calculation always to be
able to raise this alarm?
             if (ns.getStandardDeviation() > os.getStandardDeviation())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f147ca91/src/java/org/apache/cassandra/io/util/FileUtils.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/util/FileUtils.java b/src/java/org/apache/cassandra/io/util/FileUtils.java
index d522c27..39c7800 100644
--- a/src/java/org/apache/cassandra/io/util/FileUtils.java
+++ b/src/java/org/apache/cassandra/io/util/FileUtils.java
@@ -456,7 +456,7 @@ public final class FileUtils
                 deleteRecursiveOnExit(new File(dir, child));
         }
 
-        logger.trace("Scheduling deferred deletion of file: " + dir);
+        logger.trace("Scheduling deferred deletion of file: {}", dir);
         dir.deleteOnExit();
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f147ca91/src/java/org/apache/cassandra/service/StartupChecks.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StartupChecks.java b/src/java/org/apache/cassandra/service/StartupChecks.java
index 3291fbf..223da51 100644
--- a/src/java/org/apache/cassandra/service/StartupChecks.java
+++ b/src/java/org/apache/cassandra/service/StartupChecks.java
@@ -160,7 +160,7 @@ public class StartupChecks
             }
             else
             {
-                logger.info("JMX is enabled to receive remote connections on port: " + jmxPort);
+                logger.info("JMX is enabled to receive remote connections on port: {}", jmxPort);
             }
         }
     };

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f147ca91/src/java/org/apache/cassandra/utils/WindowsTimer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/WindowsTimer.java b/src/java/org/apache/cassandra/utils/WindowsTimer.java
index 9db8559..eed8eb2 100644
--- a/src/java/org/apache/cassandra/utils/WindowsTimer.java
+++ b/src/java/org/apache/cassandra/utils/WindowsTimer.java
@@ -51,7 +51,7 @@ public final class WindowsTimer
             return;
         assert(period > 0);
         if (timeBeginPeriod(period) != 0)
-            logger.warn("Failed to set timer to : " + period + ". Performance will be degraded.");
+            logger.warn("Failed to set timer to : {}. Performance will be degraded.", period);
     }
 
     public static void endTimerPeriod(int period)
@@ -60,6 +60,6 @@ public final class WindowsTimer
             return;
         assert(period > 0);
         if (timeEndPeriod(period) != 0)
-            logger.warn("Failed to end accelerated timer period. System timer will remain
set to: " + period + " ms.");
+            logger.warn("Failed to end accelerated timer period. System timer will remain
set to: {} ms.", period);
     }
 }


Mime
View raw message