grape_logging 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d165712d9c3331cabdf7c552804a46fbbe5fed5
4
- data.tar.gz: eb1ba738d4a83adfe62f74f009f9fce746a37838
3
+ metadata.gz: abce5627a8773555c3f05b4ffdc839fd051a3bf9
4
+ data.tar.gz: f28eb40f63b48bd004606238606486520de93223
5
5
  SHA512:
6
- metadata.gz: ca5fe7a0e6caf93706dcd296a1b80288d2701eb41157fde6ead417a470f7f34a997a1f3503ee33e6020f78fa4bbbdcca4f87f678cd53e7cc2d59121cf96b9b35
7
- data.tar.gz: 1d17d9f27d4b21d5bf327d08268a76dcb723640b802d795d7e1cff0bad2298c89f4ec2f11eca20cdc74af4f36a436cd2bf4ffa8b6fe67dee9c79ef4629fa5439
6
+ metadata.gz: 0d36b9d5a70622758306bfbc26277c1b314643f1b19e7e3badac1abf098aa80f1566745aab9baf467a90345154ec0386bfacd8b162fc9e578e4177f878bf1b9a
7
+ data.tar.gz: e9dbc09c6c799b23e336195179940da48a9fc7ee532aa158d3c6530033b92bb5d676194f3c6a99ecb7f3de0293a3f2a2fdf4682ec312ee84ed20747a946483f3
data/lib/grape_logging.rb CHANGED
@@ -2,6 +2,7 @@ require 'grape_logging/multi_io'
2
2
  require 'grape_logging/version'
3
3
  require 'grape_logging/formatters/default'
4
4
  require 'grape_logging/formatters/json'
5
+ require 'grape_logging/formatters/lograge'
5
6
  require 'grape_logging/formatters/logstash'
6
7
  require 'grape_logging/loggers/base'
7
8
  require 'grape_logging/loggers/response'
@@ -0,0 +1,16 @@
1
+ module GrapeLogging
2
+ module Formatters
3
+ class Lograge
4
+ def call(severity, datetime, _, data)
5
+ time = data.delete :time
6
+ attributes = {
7
+ severity: severity,
8
+ duration: time[:total],
9
+ db: time[:db],
10
+ view: time[:view]
11
+ }.merge(data)
12
+ ::Lograge.formatter.call(attributes) + "\n"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module GrapeLogging
2
- VERSION = '1.5.0'
2
+ VERSION = '1.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape_logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - aserafin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-15 00:00:00.000000000 Z
11
+ date: 2017-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape
@@ -101,6 +101,7 @@ files:
101
101
  - lib/grape_logging.rb
102
102
  - lib/grape_logging/formatters/default.rb
103
103
  - lib/grape_logging/formatters/json.rb
104
+ - lib/grape_logging/formatters/lograge.rb
104
105
  - lib/grape_logging/formatters/logstash.rb
105
106
  - lib/grape_logging/loggers/base.rb
106
107
  - lib/grape_logging/loggers/client_env.rb