Skip to content

Commit

Permalink
Merge pull request pinterest#95 from yyejun/debug_log_fix
Browse files Browse the repository at this point in the history
avoid message toString when debug not enabled
  • Loading branch information
pgarbacki committed May 20, 2015
2 parents bf0b6ab + b24f4ea commit 83d2b3f
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 @@ -87,7 +87,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 83d2b3f

Please sign in to comment.