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

[POC] Log the actual status code of the response #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ridiculous
Copy link
Owner

This approach duck punches the Rack::Head middleware to log the status code of the response. This is the first middleware in the Grape stack. The patching risk is deemed low because of the likely hood of change; it implements the established interface for #call.

Summary of how it works now:

  1. The logger class adds the logging info to a string object
  2. The string object and the given logger (or default) are passed along in the env hash
  3. The override to Rack::Head#call uses the logger to finish the request message with the finished response

@ridiculous ridiculous changed the title Log the actual status code of the response [POC] Log the actual status code of the response Sep 19, 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.

1 participant