lib/rmega/session.rb in rmega-0.0.3 vs lib/rmega/session.rb in rmega-0.0.4
- old
+ new
@@ -7,12 +7,12 @@
self.request_id = random_request_id
login password_str
end
- def debug message
- Rmega.logger.debug message
+ def logger
+ Rmega.logger
end
# Delegate to Rmega.options
@@ -59,13 +59,13 @@
def request body
self.request_id += 1
url = "#{api_url}?id=#{request_id}"
url << "&sid=#{sid}" if sid
- debug "POST #{url}"
- debug "#{body.inspect}"
+ logger.info "POST #{url}"
+ logger.info "#{body.inspect}"
response = HTTPClient.new.post url, [body].to_json, timeout: api_request_timeout
- debug "#{response.code}\n#{response.body}"
+ logger.debug "#{response.code}\n#{response.body}"
resp = JSON.parse(response.body).first
raise ApiRequestError.new(resp) if ApiRequestError.is_error_code?(resp)
resp
end
end