Created
November 21, 2011 17:39
-
-
Save jeremy/1383337 to your computer and use it in GitHub Desktop.
Using Rails log for RestClient.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'restclient' | |
# RestClient logs using << which isn't supported by the Rails logger, | |
# so wrap it up with a little proxy object. | |
RestClient.log = | |
Object.new.tap do |proxy| | |
def proxy.<<(message) | |
Rails.logger.info message | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!