Sha256: d4ac222a229cb2026cde9ba25db2f389a132e3eb4c58b6156c75c3dd229fb19c

Contents?: true

Size: 1.13 KB

Versions: 10

Compression:

Stored size: 1.13 KB

Contents

# *Flexirest:* Logging

## Verbose

You can turn on verbose logging to see what is sent to the API server and what is returned in one of these two ways:

```ruby
class Article < Flexirest::Base
  verbose!
end

# or if you prefer

class Person < Flexirest::Base
  verbose true
end
```

By default verbose logging isn't enabled, so it's up to the developer to enable it (and remember to disable it afterwards). It does use debug level logging, so it shouldn't fill up a correctly configured production server anyway.

If you prefer to record the output of an API call in a more automated fashion you can use a callback called `record_response` like this:

```ruby
class Article < Flexirest::Base
  record_response do |url, response|
    File.open(url.parameterize, "w") do |f|
      f << response.body
    end
  end
end
```

## Quiet

By the same token, if you want to silence all log output from Flexirest, you can use quiet:

```ruby
class Article < Flexirest::Base
  quiet!
end

# or if you prefer

class Person < Flexirest::Base
  quiet true
end
```

-----

[< Filtering result lists](filtering-result-lists.md) | [XML responses >](xml-responses.md)

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
flexirest-1.12.4 docs/logging.md
flexirest-1.12.3 docs/logging.md
flexirest-1.12.2 docs/logging.md
flexirest-1.12.1 docs/logging.md
flexirest-1.12.0 docs/logging.md
flexirest-1.11.3 docs/logging.md
flexirest-1.11.2 docs/logging.md
flexirest-1.11.1 docs/logging.md
flexirest-1.11.0 docs/logging.md
flexirest-1.10.12 docs/logging.md