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 +4 -4
- data/lib/grape_logging.rb +1 -0
- data/lib/grape_logging/formatters/lograge.rb +16 -0
- data/lib/grape_logging/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abce5627a8773555c3f05b4ffdc839fd051a3bf9
|
4
|
+
data.tar.gz: f28eb40f63b48bd004606238606486520de93223
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
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
|