lib/bobot/graph_facebook.rb in bobot-2.6.2 vs lib/bobot/graph_facebook.rb in bobot-3.0.1
- old
+ new
@@ -17,14 +17,12 @@
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.read_timeout = 300
end
res = https.request(req)
json = ActiveSupport::JSON.decode(res.send(:body) || '{}')
- if Bobot.config.debug_log
- puts "[GET] >> #{uri.request_uri}"
- puts "[GET] << #{json}"
- end
+ Rails.logger.debug "[GET] >> #{uri.request_uri}"
+ Rails.logger.debug "[GET] << #{json}"
Bobot::ErrorParser.raise_errors_from(json)
json
end
module_function :graph_get
@@ -42,14 +40,12 @@
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.read_timeout = 300
end
res = https.request(req)
json = ActiveSupport::JSON.decode(res.send(:body) || '{}')
- if Bobot.config.debug_log
- puts "[POST] >> #{uri.request_uri}"
- puts "[POST] << #{json}"
- end
+ Rails.logger.debug "[POST] >> #{uri.request_uri}"
+ Rails.logger.debug "[POST] << #{json}"
Bobot::ErrorParser.raise_errors_from(json)
json
end
module_function :graph_post
@@ -67,13 +63,11 @@
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.read_timeout = 300
end
res = https.request(req)
json = ActiveSupport::JSON.decode(res.send(:body) || '{}')
- if Bobot.config.debug_log
- puts "[DELETE] >> #{uri.request_uri}"
- puts "[DELETE] << #{json}"
- end
+ Rails.logger.debug "[DELETE] >> #{uri.request_uri}"
+ Rails.logger.debug "[DELETE] << #{json}"
Bobot::ErrorParser.raise_errors_from(json)
json
end
module_function :graph_delete
end