event_tracer 0.4.6 → 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/lib/event_tracer/buffered_logger.rb +2 -0
- data/lib/event_tracer/config.rb +2 -0
- data/lib/event_tracer/error_with_payload.rb +10 -0
- data/lib/event_tracer/version.rb +1 -1
- data/lib/event_tracer.rb +9 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f84ff22349c762a429e58f5913884a3eff066c983881ed16d9f846785c27184f
|
4
|
+
data.tar.gz: ccb8508e0eba3e08f2312248618d2fff80ff5bab70c08c5c9754b04ee000088e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 588eb7e39ca26221be2c15a986d5862a6f102713a8be329e245ae086c0503daa0c2e1d54d5996a008c1a6a93855f5f16b33eea551902438926fb1e29dcd29720
|
7
|
+
data.tar.gz: 43d3d079f656213b87f8666bca064dd83910282a4f7ffe3bb9dc1106f25ceea8c6b2e6dafbb8181c20c1377e515a6a37311cb495d4b9cab7c48016f2a79124ea
|
data/lib/event_tracer/config.rb
CHANGED
@@ -12,6 +12,7 @@ module EventTracer
|
|
12
12
|
setting :dynamo_db_table_name, default: 'logs'
|
13
13
|
setting :dynamo_db_client
|
14
14
|
setting :dynamo_db_queue_name, default: 'low'
|
15
|
+
setting :error_handler, default: ->(error, _payload) { raise error }
|
15
16
|
else
|
16
17
|
setting :app_name, 'app_name'
|
17
18
|
|
@@ -19,6 +20,7 @@ module EventTracer
|
|
19
20
|
setting :dynamo_db_table_name, 'logs'
|
20
21
|
setting :dynamo_db_client
|
21
22
|
setting :dynamo_db_queue_name, 'low'
|
23
|
+
setting :error_handler, ->(error, _payload) { raise error }
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
data/lib/event_tracer/version.rb
CHANGED
data/lib/event_tracer.rb
CHANGED
@@ -32,7 +32,15 @@ module EventTracer
|
|
32
32
|
|
33
33
|
loggers.each do |code, logger|
|
34
34
|
if args[:action] && args[:message]
|
35
|
-
|
35
|
+
begin
|
36
|
+
result.record code, logger.send(log_type, **args)
|
37
|
+
rescue EventTracer::ErrorWithPayload => error
|
38
|
+
EventTracer::Config.config.error_handler.call(error.cause || error, error.payload)
|
39
|
+
result.record code, LogResult.new(false, error.message)
|
40
|
+
rescue StandardError => error
|
41
|
+
EventTracer::Config.config.error_handler.call(error, args)
|
42
|
+
result.record code, LogResult.new(false, error.message)
|
43
|
+
end
|
36
44
|
else
|
37
45
|
result.record code, LogResult.new(false, 'Fields action & message need to be populated')
|
38
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event_tracer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- melvrickgoh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- lib/event_tracer/dynamo_db/default_processor.rb
|
101
101
|
- lib/event_tracer/dynamo_db/logger.rb
|
102
102
|
- lib/event_tracer/dynamo_db/worker.rb
|
103
|
+
- lib/event_tracer/error_with_payload.rb
|
103
104
|
- lib/event_tracer/log_result.rb
|
104
105
|
- lib/event_tracer/version.rb
|
105
106
|
homepage: https://github.com/melvrickgoh/event_tracer
|