GitHub user KoenDG opened a pull request:
https://github.com/apache/kafka/pull/3891
[WIP] MINOR: Further code cleanup involving log statements
First of all, terribly sorry for not having included this in the previous
PR, that one only focused on the streams folder, this one is on the entire
project. I realized my mistake too late.
I do need some input for this one, I left 2 TODO statements in the code
that I'll point out.
This commit largely replaces string concatenation with placeholders in
debug and trace log statements. Other things I'll point out with comments.
For historical purposes, on why replacing string concatenation with
placeholders: When running an application on a certain log level, one wants to
avoid log statements of more detailed levels actually being evaluated, both due
to potential size issues and time spent doing it, since they're not actually
going to be printed. If the message being passed to the log method utilizes
string concatenation directly in the passed argument, that means the string
will be fully evaluated before being passed along to the log method, to then
potentially not even be shown, if the application is running on a different log
level.
Using placeholders prevents this from happening.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/KoenDG/kafka logPlaceholders
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/3891.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3891
----
commit ae179142dc91ab137eb8f0b3ec606f9a12f36f9f
Author: coscale_kdegroot <[email protected]>
Date: 2017-09-18T12:35:26Z
WIP, need input on 2 cases in the code.
This commit largely replaces string concatenation with placeholders in
debug and trace log statements.
----
---