{"action":"created","issue":{"url":"https://api.github.com/repos/typhoeus/typhoeus/issues/388","labels_url":"https://api.github.com/repos/typhoeus/typhoeus/issues/388/labels{/name}","comments_url":"https://api.github.com/repos/typhoeus/typhoeus/issues/388/comments","events_url":"https://api.github.com/repos/typhoeus/typhoeus/issues/388/events","html_url":"https://github.com/typhoeus/typhoeus/pull/388","id":37975751,"number":388,"title":"Include more information in request string representation","user":{"login":"iamvery","id":79619,"avatar_url":"https://avatars.githubusercontent.com/u/79619?v=3","gravatar_id":"","url":"https://api.github.com/users/iamvery","html_url":"https://github.com/iamvery","followers_url":"https://api.github.com/users/iamvery/followers","following_url":"https://api.github.com/users/iamvery/following{/other_user}","gists_url":"https://api.github.com/users/iamvery/gists{/gist_id}","starred_url":"https://api.github.com/users/iamvery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamvery/subscriptions","organizations_url":"https://api.github.com/users/iamvery/orgs","repos_url":"https://api.github.com/users/iamvery/repos","events_url":"https://api.github.com/users/iamvery/events{/privacy}","received_events_url":"https://api.github.com/users/iamvery/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-07-16T12:18:38Z","updated_at":"2015-06-11T13:15:28Z","closed_at":"2015-06-11T13:14:45Z","pull_request":{"url":"https://api.github.com/repos/typhoeus/typhoeus/pulls/388","html_url":"https://github.com/typhoeus/typhoeus/pull/388","diff_url":"https://github.com/typhoeus/typhoeus/pull/388.diff","patch_url":"https://github.com/typhoeus/typhoeus/pull/388.patch"},"body":"## The Problem\r\n\r\nTyphoeus does not override the default implementation for `to_s` on the `Typhoeus::Request` object.\r\n\r\n## The Motivation\r\n\r\nThe default string presentation of `Typhoeus::Request` objects is generally unhelpful:\r\n\r\n```ruby\r\nrequest = Typhoeus::Request.new('http://localhost')\r\nrequest.to_s\r\n=> \"#<Typhoeus::Request:0x007fdb91c58a18>\"\r\n```\r\n\r\nOne may want to log the request, but the only way to do so presently is to log each \"piece\" of the request individually. A contrived example:\r\n\r\n```ruby\r\nLogger.info(\"Request: url=#{request.url} options=#{request.options}\")\r\n```\r\n\r\nIt would be pretty cool if one could get helpful information by logging the request itself:\r\n\r\n```ruby\r\nLogger.info(\"Request: #{request}\")\r\n```\r\n\r\n1. Simpler logging.\r\n2. Possibly more robust (assuming a good string representation)\r\n\r\n## The Solution\r\n\r\nI didn't feel qualified to make decisions about how to best represent a `Typhoeus::Request` as a string, so I went with the simplest solution of delegating the call to Object#inspect.\r\n\r\nLet me know what you think! I'm happy to adjust the implementation, rebase, etc. as needed."},"comment":{"url":"https://api.github.com/repos/typhoeus/typhoeus/issues/comments/111129960","html_url":"https://github.com/typhoeus/typhoeus/pull/388#issuecomment-111129960","issue_url":"https://api.github.com/repos/typhoeus/typhoeus/issues/388","id":111129960,"user":{"login":"iamvery","id":79619,"avatar_url":"https://avatars.githubusercontent.com/u/79619?v=3","gravatar_id":"","url":"https://api.github.com/users/iamvery","html_url":"https://github.com/iamvery","followers_url":"https://api.github.com/users/iamvery/followers","following_url":"https://api.github.com/users/iamvery/following{/other_user}","gists_url":"https://api.github.com/users/iamvery/gists{/gist_id}","starred_url":"https://api.github.com/users/iamvery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamvery/subscriptions","organizations_url":"https://api.github.com/users/iamvery/orgs","repos_url":"https://api.github.com/users/iamvery/repos","events_url":"https://api.github.com/users/iamvery/events{/privacy}","received_events_url":"https://api.github.com/users/iamvery/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T13:15:28Z","updated_at":"2015-06-11T13:15:28Z","body":"(✿◠‿◠)"}}