ruby-on-rails – 在Rails应用程序中记录RestClient
我想调试我的Rails应用程序使用
RestClient创建的请求.RestClient文档说:
如何将这些日志包含在我的Rails应用程序日志文件夹中? 解决方法
来自:
https://gist.github.com/jeremy/1383337
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 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |