1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00

Call out syntax for logging on a single request.

This commit is contained in:
Andy Brody 2017-04-28 01:44:19 -04:00
parent 18332b4461
commit 4130d0e00f

View file

@ -537,12 +537,17 @@ To enable logging globally you can:
$ RESTCLIENT_LOG=stdout path/to/my/program
```
You can also set individual loggers when instantiating a Resource:
You can also set individual loggers when instantiating a Resource or making an
individual request:
```ruby
resource = RestClient::Resource.new 'http://example.com/resource', log: Logger.new(STDOUT)
```
```ruby
RestClient::Request.execute(method: :get, url: 'http://example.com/foo', log: Logger.new(STDERR))
```
All options produce logs like this:
```ruby