Only evaluate strings for debug logging messages if required #375

Merged
merged 1 commit into from Jan 26, 2016

Conversation

Projects
None yet
2 participants
@thedrow
Contributor

thedrow commented Jan 26, 2016

Most of the times debug messages are not logged so it's a best practice to avoid evaluating strings that are used in debugging log messages unless they are required.

@thedrow

This comment has been minimized.

Show comment
Hide comment
@thedrow

thedrow Jan 26, 2016

Contributor

Should we do this for INFO level log message as well?

Contributor

thedrow commented Jan 26, 2016

Should we do this for INFO level log message as well?

@michaelklishin

This comment has been minimized.

Show comment
Hide comment
@michaelklishin

michaelklishin Jan 26, 2016

Member

I'm not convinced there's a whole lot of value in doing this even for debug messages. I certainly don't see any point in doing this for info messages: pretty much everybody I know uses Bunny with info logging enabled.

Member

michaelklishin commented Jan 26, 2016

I'm not convinced there's a whole lot of value in doing this even for debug messages. I certainly don't see any point in doing this for info messages: pretty much everybody I know uses Bunny with info logging enabled.

@michaelklishin michaelklishin self-assigned this Jan 26, 2016

michaelklishin added a commit that referenced this pull request Jan 26, 2016

Merge pull request #375 from thedrow/lazy-debug-logging-strings
Only evaluate strings for debug logging messages if required

@michaelklishin michaelklishin merged commit f2da12d into ruby-amqp:master Jan 26, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@thedrow

This comment has been minimized.

Show comment
Hide comment
@thedrow

thedrow Jan 26, 2016

Contributor

It's simply slightly faster if you don't use the the logger at debug level.

Contributor

thedrow commented Jan 26, 2016

It's simply slightly faster if you don't use the the logger at debug level.

@thedrow thedrow deleted the thedrow:lazy-debug-logging-strings branch Jan 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment