epilog 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGLOG.md +5 -0
- data/lib/epilog/context_logging.rb +1 -0
- data/lib/epilog/rails/action_controller_subscriber.rb +29 -16
- data/lib/epilog/rails/active_job_subscriber.rb +2 -0
- data/lib/epilog/rails/log_subscriber.rb +4 -0
- data/lib/epilog/rails/railtie.rb +2 -0
- data/lib/epilog/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 489f54c6b2527b191f528402ea23ee3188d98705dc9c06f995176c38110e3ff9
|
4
|
+
data.tar.gz: 65ec51b26a5b23cde1fd997d02d743d78ffb193df568f770b513e9b6d9010320
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc8a27b6da915720290f5e23acf02f7fc3e0afeb79608365bb09fb7d799c9d0663f5f9010472b5beb962bbe6cdbd3653239effbc390b97cd9c1ea56c2da8c8cd
|
7
|
+
data.tar.gz: f2b9f9ffcfaf8fdf021bdea32ee086ae440d919501bc6a342f1dd854b9507590b0b40b70b40118918307805c8a519ed7fc70e03b6b18d0b257573126afe0224d
|
data/CHANGLOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.5.0
|
4
|
+
|
5
|
+
- Add options to enable/disable start and end logs [#15](https://github.com/machinima/epilog/pull/15)
|
6
|
+
- Fix with_context to use ensure [#16](https://github.com/machinima/epilog/pull/16)
|
7
|
+
|
3
8
|
## 0.4.0
|
4
9
|
|
5
10
|
- Add context support to Logger [#12](https://github.com/machinima/epilog/pull/12)
|
@@ -12,25 +12,11 @@ module Epilog
|
|
12
12
|
.merge(event.payload[:context])
|
13
13
|
)
|
14
14
|
|
15
|
-
|
16
|
-
{
|
17
|
-
message: "#{request_string(event)} started",
|
18
|
-
request: request_hash(event)
|
19
|
-
}
|
20
|
-
end
|
15
|
+
log_start(event) if config.double_request_logs
|
21
16
|
end
|
22
17
|
|
23
18
|
def process_request(event)
|
24
|
-
|
25
|
-
{
|
26
|
-
message: response_string(event),
|
27
|
-
request: short_request_hash(event),
|
28
|
-
response: response_hash(event),
|
29
|
-
metrics: process_metrics(event.payload[:metrics]
|
30
|
-
.merge(request_runtime: event.duration.round(2)))
|
31
|
-
}
|
32
|
-
end
|
33
|
-
|
19
|
+
log_end(event)
|
34
20
|
pop_context
|
35
21
|
end
|
36
22
|
|
@@ -84,6 +70,33 @@ module Epilog
|
|
84
70
|
|
85
71
|
private
|
86
72
|
|
73
|
+
def log_start(event)
|
74
|
+
info do
|
75
|
+
{
|
76
|
+
message: "#{request_string(event)} started",
|
77
|
+
request: request_hash(event)
|
78
|
+
}
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def log_end(event) # rubocop:disable MethodLength
|
83
|
+
request = if config.double_request_logs
|
84
|
+
short_request_hash(event)
|
85
|
+
else
|
86
|
+
request_hash(event)
|
87
|
+
end
|
88
|
+
|
89
|
+
info do
|
90
|
+
{
|
91
|
+
message: response_string(event),
|
92
|
+
request: request,
|
93
|
+
response: response_hash(event),
|
94
|
+
metrics: process_metrics(event.payload[:metrics]
|
95
|
+
.merge(request_runtime: event.duration.round(2)))
|
96
|
+
}
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
87
100
|
def request_hash(event) # rubocop:disable AbcSize, MethodLength
|
88
101
|
request = event.payload[:request]
|
89
102
|
param_filter = request.send(:parameter_filter)
|
data/lib/epilog/rails/railtie.rb
CHANGED
data/lib/epilog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epilog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Howard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|