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:
parent
18332b4461
commit
4130d0e00f
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue