<commit_before>## What

Structured, key-value logging for your rack apps. Inspired by lograge.

## Use It

```ruby
class App < Sinatra::Base
  use Rack::KeyValueLogger
end
```

## TODO

* Allow passing in string or IO object instead of full logger instance. This is probably a performance issue since middlewares get instantiated on every request.<commit_msg>Update readme with failure response example<commit_after>## What

Structured, key-value logging for your rack apps. Inspired by lograge.

## Use It

```ruby
class App < Sinatra::Base
  use Rack::KeyValueLogger
end

# To log response bodies for failure response codes
class App < Sinatra::Base
  use Rack::KeyValueLogger, :log_failure_response_bodies => true
end
```

## TODO

* Allow passing in string or IO object instead of full logger instance. This is probably a performance issue since middlewares get instantiated on every request.
{'fraction_non_alphanumeric': 0.07142857142857142, 'fraction_numerical': 0.0, 'mean_word_length': 4.824675324675325, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1580490', 'n_tokens_mistral': 251, 'n_tokens_neox': 241, 'n_words': 114}