Add gem version badge to readme

This commit is contained in:
Sami Samhuri 2025-06-28 07:44:35 -04:00
parent f35dc1e9d6
commit 9e4fb8266b
No known key found for this signature in database

View file

@ -1,5 +1,6 @@
# grape_logging # grape_logging
[![Gem Version](https://badge.fury.io/rb/grape_logging.svg)](https://badge.fury.io/rb/grape_logging)
[![CI](https://github.com/aserafin/grape_logging/actions/workflows/ci.yml/badge.svg)](https://github.com/aserafin/grape_logging/actions/workflows/ci.yml) [![CI](https://github.com/aserafin/grape_logging/actions/workflows/ci.yml/badge.svg)](https://github.com/aserafin/grape_logging/actions/workflows/ci.yml)
## Installation ## Installation
@ -18,7 +19,7 @@ Or install it yourself as:
## Basic Usage ## 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 ```ruby
require 'grape_logging' require 'grape_logging'
@ -158,7 +159,7 @@ You can control the level used to log. The default is `info`.
```ruby ```ruby
class MyAPI < Grape::API class MyAPI < Grape::API
insert_before Grape::Middleware::Error, insert_before Grape::Middleware::Error,
GrapeLogging::Middleware::RequestLogger, GrapeLogging::Middleware::RequestLogger,
logger: logger, logger: logger,
log_level: 'debug' log_level: 'debug'