Skip to content

Instantly share code, notes, and snippets.

@jeremy
Created November 21, 2011 17:39
Show Gist options
  • Save jeremy/1383337 to your computer and use it in GitHub Desktop.
Save jeremy/1383337 to your computer and use it in GitHub Desktop.
Using Rails log for RestClient.log
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
@sampierson
Copy link

Thanks!

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