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

Removed fixed log level from Logger #1839

Merged
merged 1 commit into from May 9, 2018

Conversation

Projects
None yet
3 participants
@insdami
Contributor

insdami commented May 9, 2018

A small PR to remove log4s dependency from Logger and the fixed log level (info).

before:

Logger.logMessage[F, Message[F]](msg)(logHeaders, logBody)(org.log4s.Logger)

now:

Logger.logMessage[F, Message[F]](msg)(logHeaders, logBody)(message => log.info(message) // or .warn, .error, etc.)
@rossabaker

One thing I just noticed about our Logger implementation is that we construct the String whether or not the logging level is enabled. logger.info(s) avoids the construction of an expensive s, whereas this signature materializes the string before passing it off to log.

Then again, we're paying for the string anyway in the current implementation. So I think this is an improvement, but we can still do better here.

@rossabaker

This comment has been minimized.

Member

rossabaker commented May 9, 2018

CI failure is ongoing Travis network issue.

@rossabaker rossabaker merged commit 7a1cb99 into http4s:master May 9, 2018

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment