pier_logging 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e7b8e8a3faa275bd06c3c99bc040674438cad11985026b2eebca94d8d7cceb7
4
- data.tar.gz: a543d0ec8e3041658df53bdb74c05c3aae9c859f3117d4dd6d848fb2ed06e249
3
+ metadata.gz: 1edbf6a4c1e0e1bcce41d72a274024cc03c3cbe1f1b7d024895ff9e22233c3de
4
+ data.tar.gz: f8e35c6786a7f91ad63390ba2e967c585515347e2f5a572e0207d85b701ab3f3
5
5
  SHA512:
6
- metadata.gz: e7d627a1ee316a282b4399d1b780aa2b62a1c7aefaa2fbee3380472dd4ef4d21a9ab5084fd228b4625d34508a901d3651d65db485f45d95d7967b5414159a6c8
7
- data.tar.gz: dbce9f07acd69a6643ec8de023b1ffb5dc293002a6a2283ead3ebe2ba9153d5dd1d1cfade9d1fcad94019d3686e19354547dab380c4eb26570cacf0bc5e854fc
6
+ metadata.gz: 59cd614cbff2b29fa81ee854550774e9257eef41606683be53b80f436fbcf111cb6487d81fb4190e1b06a054d83b77225da1700120c456ca90808270ba7cbcb4
7
+ data.tar.gz: 7119018bce9343ac5a9542a0ab11b28656b8853e22d33b5cf14eb00f50e827606a4c0731209255c6e698d0d0a5dff1d4b4ebf5066bf279fff24c2d99d5c20663
@@ -6,6 +6,7 @@ require "pier_logging/request_logger"
6
6
  require "pier_logging/formatter/base"
7
7
  require "pier_logging/formatter/json"
8
8
  require "pier_logging/formatter/readable"
9
+ require "pier_logging/helpers/headers"
9
10
 
10
11
  module PierLogging
11
12
  def self.logger_configuration
@@ -87,16 +87,15 @@ module PierLogging
87
87
  end
88
88
 
89
89
  def parse_body(body)
90
- if body.is_a? String # when string
91
- Oj.load(body, allow_blank: true)
92
- elsif body.is_a? Array # Grape body
93
- Oj.load(body.last, allow_blank: true)
94
- elsif body.is_a? ActionDispatch::Response::RackBody # Rails body
95
- Oj.load(body.body, allow_blank: true)
96
- else
97
- body
98
- end
90
+ body_object = get_body_object(body)
91
+ Oj.load(body_object, allow_blank: true)
99
92
  rescue
93
+ body_object || body
94
+ end
95
+
96
+ def get_body_object(body)
97
+ return body.last if body.is_a? Array # Grape body
98
+ return body.body if body.is_a? ActionDispatch::Response::RackBody # Rails body
100
99
  body
101
100
  end
102
101
 
@@ -1,3 +1,3 @@
1
1
  module PierLogging
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pier_logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauricio Banduk