mirror of
https://github.com/samsonjs/grape_logging.git
synced 2026-03-25 08:55:47 +00:00
Add gem version badge to readme
This commit is contained in:
parent
f35dc1e9d6
commit
9e4fb8266b
1 changed files with 3 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
|||
# grape_logging
|
||||
|
||||
[](https://badge.fury.io/rb/grape_logging)
|
||||
[](https://github.com/aserafin/grape_logging/actions/workflows/ci.yml)
|
||||
|
||||
## Installation
|
||||
|
|
@ -18,7 +19,7 @@ Or install it yourself as:
|
|||
|
||||
## Basic Usage
|
||||
|
||||
In your api file (somewhere on the top), insert grape logging middleware before grape error middleware. This is important due to the behaviour of `lib/grape/middleware/error.rb`, which manipulates the status of the response when there is an error.
|
||||
In your API file (somewhere on the top), insert grape logging middleware before grape error middleware. This is important due to the behaviour of `lib/grape/middleware/error.rb`, which manipulates the status of the response when there is an error.
|
||||
|
||||
```ruby
|
||||
require 'grape_logging'
|
||||
|
|
@ -158,7 +159,7 @@ You can control the level used to log. The default is `info`.
|
|||
|
||||
```ruby
|
||||
class MyAPI < Grape::API
|
||||
insert_before Grape::Middleware::Error,
|
||||
insert_before Grape::Middleware::Error,
|
||||
GrapeLogging::Middleware::RequestLogger,
|
||||
logger: logger,
|
||||
log_level: 'debug'
|
||||
|
|
|
|||
Loading…
Reference in a new issue