Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java-modules: report location information only when 'loglevel <= DEBUG' #1243

Merged
merged 1 commit into from Oct 26, 2016

Conversation

MrAnno
Copy link
Collaborator

@MrAnno MrAnno commented Oct 26, 2016

Requesting location information (class name, method name, line number) is a slow operation, this should be displayed only in DEBUG (and TRACE) mode.

Requesting location information (class name, method name, line number)
is a slow operation, this should be displayed only in DEBUG (and TRACE)
mode.

Signed-off-by: László Várady <laszlo.varady@balabit.com>
}
else {
StringBuilder formatedMessage = new StringBuilder();
formatedMessage.append(event.getLocationInformation().getClassName());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicking: is not it cleaner to create a list for part of the formatted message and then loop over that list and append it to formattedMessage?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LocationInfo doesn't implement the Iterable or Collection interface, so I would have to add the message parts one by one to the list. I think this is the same ugly logic as the current one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks. :)

@lbudai
Copy link
Collaborator

lbudai commented Oct 26, 2016

Thanks!

@lbudai lbudai merged commit 123809d into syslog-ng:master Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants