Skip to content

Instantly share code, notes, and snippets.

@jeremy
Created November 21, 2011 17:39
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • 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