Skip to content

Commit

Permalink
avoid message toString when debug not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Yejun Yang committed May 20, 2015
1 parent 9937d7d commit b24f4ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public Message read() {
updateAccessTime(topicPartition);
// Skip already committed messages.
long committedOffsetCount = mOffsetTracker.getTrueCommittedOffsetCount(topicPartition);
LOG.debug("read message" + message);
LOG.debug("read message {}", message);
exportStats();
if (message.getOffset() < committedOffsetCount) {
LOG.debug("skipping message message " + message + " because its offset precedes " +
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/pinterest/secor/writer/MessageWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void write(ParsedMessage message) throws Exception {
mFileExtension);
FileWriter writer = mFileRegistry.getOrCreateWriter(path, mCodec);
writer.write(new KeyValue(message.getOffset(), message.getPayload()));
LOG.debug("appended message " + message + " to file " + path.getLogFilePath() +
". File length " + writer.getLength());
LOG.debug("appended message {} to file {}. File length {}",
message, path.getLogFilePath(), writer.getLength());
}
}

0 comments on commit b24f4ea

Please sign in to comment.