-
Notifications
You must be signed in to change notification settings - Fork 961
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
Added initial logging support. #243
Conversation
Travis CI is showing a test failure. Can you fix that up? |
👍 |
1 similar comment
👍 |
👍 Really useful! :D |
👍 |
1 similar comment
👍 |
end | ||
|
||
def format(request, response) | ||
@current_time ||= Time.new.strftime("%Y-%m-%d %H:%M:%S.%L %z") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this make it always use the same time?
Getting really close. Thanks for all the work! |
The memoization was there because it was hard to test using Also, I created the raw_body method as requested. |
Merged. Thanks. |
The idea is that you can log your requests using either the
include
syntax and the directHTTParty
class.Using include:
Using HTTParty:
I have included two log styles, one that resembles apache's access log and another that resembles curl, which can be used by passing
:log_format => :curl
.You can also control which method is called on logger by passing
:log_level => :debug
for example.Please let me know if the code does not adhere to the project's standards or if I need to change anything.
Opinions and criticism are welcome.