hermes_messenger_of_the_gods 2.3.2 → 2.3.3

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
  SHA256:
3
- metadata.gz: 45e46de302befb016769708d8ec0e3d500e1dc3d83f3c2759eb37e089df3f54d
4
- data.tar.gz: f678ce9af82af7750fce178b117c2e4fcc79a133d1e79d132d1ec9e29b9428c7
3
+ metadata.gz: 4c3b23fec66c0a1e150672c00be3bff512ae95edb8159c5f4d43b83198df9f0a
4
+ data.tar.gz: 1bfa70e4c8e9bb56c0d3e27e625239e03eeb16567119eee90f7c55ea9043146e
5
5
  SHA512:
6
- metadata.gz: b4bfd0c75c08192c83866e6a5c744b9b4670a84858c93afcf24aab0af4ab8edb2ac2f7de7dc2d4dadc02eb27e906b34293a16d1fa0e5a75c35a35ba79618f30c
7
- data.tar.gz: 64c3bdc04eaeebdfa0a73c0f7c0654f2274c2ef9a8f44f145b868b7805be971303a6b5e4df24b89522c7e348788dee68c67634e153b854820d93a72ae431a5c2
6
+ metadata.gz: b32b27892082385431cc44a19f7552a6d1b788a55067576713ad9e9cff7ff147ea3ac693de7134730531af75285e4d1a62cceafe899a1857a85f51de3fc620b9
7
+ data.tar.gz: 1f46c52269a3c7df4d422813dfba7c6c391772cc9b3e3b64da9a79f9c1aeaa30561612d2ec5558d155953588a5a7fc39bcc40164f39565ed913566b570ee7615
@@ -43,7 +43,7 @@ module HermesMessengerOfTheGods
43
43
  #
44
44
  # Break from polling
45
45
  def shutdown!
46
- warn 'Shutdown command received'
46
+ warn 'Reveived shutdown signal'
47
47
  @shutdown = true
48
48
  end
49
49
 
@@ -144,8 +144,8 @@ module HermesMessengerOfTheGods
144
144
  set_message_visibility(inflight_messages, new_time)
145
145
  sleep VISIBILITY_EXTEND_FREQUENCY
146
146
  rescue StandardError => e
147
- warn 'Error received trying to extend visibility'
148
- warn e.message
147
+ say_warn 'Error received trying to extend visibility'
148
+ say_warn e.message
149
149
 
150
150
  raise
151
151
  end
@@ -6,7 +6,7 @@ module HermesMessengerOfTheGods
6
6
 
7
7
  included do
8
8
  Logger::Severity.constants.each do |sev|
9
- define_method(sev.downcase) do |msg = nil, &blk|
9
+ define_method("say_#{sev.downcase}") do |msg = nil, &blk|
10
10
  say("Logger::#{sev}".constantize, msg, &blk)
11
11
  end
12
12
  end
@@ -13,41 +13,41 @@ module HermesMessengerOfTheGods
13
13
 
14
14
  @subscriptions = [
15
15
  ActiveSupport::Notifications.subscribe('hermes_messenger_of_the_gods.worker.starting') do |*_, payload|
16
- payload[:worker].info { "Starting Worker" }
16
+ payload[:worker].say_info { "Starting Worker" }
17
17
  end,
18
18
  ActiveSupport::Notifications.subscribe('hermes_messenger_of_the_gods.worker.run_job') do |_, start, finish, _, payload|
19
- payload[:worker].debug { "Completed #{to_log_s(payload[:job])} in #{finish - start}s" }
19
+ payload[:worker].say_debug { "Completed #{to_log_s(payload[:job])} in #{finish - start}s" }
20
20
  end,
21
21
  ActiveSupport::Notifications.subscribe('hermes_messenger_of_the_gods.worker.starting_job') do |*_, payload|
22
- payload[:worker].info { "Starting Job #{to_log_s(payload[:job])}" }
22
+ payload[:worker].say_info { "Starting Job #{to_log_s(payload[:job])}" }
23
23
  end,
24
24
  ActiveSupport::Notifications.subscribe('hermes_messenger_of_the_gods.worker.success') do |*_, payload|
25
- payload[:worker].info { "Finished Job #{to_log_s(payload[:job])}" }
25
+ payload[:worker].say_info { "Finished Job #{to_log_s(payload[:job])}" }
26
26
  end,
27
27
  ActiveSupport::Notifications.subscribe('hermes_messenger_of_the_gods.worker.failure') do |*_, payload|
28
- payload[:worker].error { "Error in #{to_log_s(payload[:job])}: #{payload[:error].message}" }
29
- payload[:worker].debug { "backtrace: #{payload[:error].backtrace}" }
28
+ payload[:worker].say_error { "Error in #{to_log_s(payload[:job])}: #{payload[:error].message}" }
29
+ payload[:worker].say_debug { "backtrace: #{payload[:error].backtrace}" }
30
30
  end,
31
31
  ActiveSupport::Notifications.subscribe('hermes_messenger_of_the_gods.worker.fatal_error') do |*_, payload|
32
- payload[:worker].error { "Fatal Error: #{to_log_s(payload[:job])}: #{payload[:exception].message}" }
33
- payload[:worker].debug { "backtrace: #{payload[:exception].backtrace}" }
32
+ payload[:worker].say_error { "Fatal Error: #{to_log_s(payload[:job])}: #{payload[:exception].message}" }
33
+ payload[:worker].say_debug { "backtrace: #{payload[:exception].backtrace}" }
34
34
  end,
35
35
  # Message Output
36
36
  ActiveSupport::Notifications.subscribe('hermes_messenger_of_the_gods.message.dispatch') do |_, _start, _finish, _, payload|
37
- payload[:message].info { "Dispatch complete in #{to_log_s(payload[:job])}s" }
37
+ payload[:message].say_info { "Dispatch complete in #{to_log_s(payload[:job])}s" }
38
38
  end,
39
39
  ActiveSupport::Notifications.subscribe('hermes_messenger_of_the_gods.message.dispatch_failure') do |*_, payload|
40
- payload[:message].debug { "Dispatch failure to #{to_log_s(payload[:job])}: #{payload[:exception].inspect}" }
40
+ payload[:message].say_debug { "Dispatch failure to #{to_log_s(payload[:job])}: #{payload[:exception].inspect}" }
41
41
  end,
42
42
  # Endpoint Output
43
43
  ActiveSupport::Notifications.subscribe('hermes_messenger_of_the_gods.endpoint.dispatch') do |_, start, finish, _, payload|
44
- payload[:endpoint].info { "Dispatch complete in #{finish - start}s #{" FAILED" if payload.has_key?(:exception)}" }
44
+ payload[:endpoint].say_info { "Dispatch complete in #{finish - start}s #{" FAILED" if payload.has_key?(:exception)}" }
45
45
  end,
46
46
  ActiveSupport::Notifications.subscribe(/hermes_messenger_of_the_gods.endpoint.(dispatch|final)_failure/) do |name, *_, payload|
47
- payload[:endpoint].debug { "Dispatch #{"final " if name.include?('final_')} failure ##{payload[:try]} to #{payload[:endpoint_name]}: #{payload[:exception].inspect}" }
47
+ payload[:endpoint].say_debug { "Dispatch #{"final " if name.include?('final_')} failure ##{payload[:try]} to #{payload[:endpoint_name]}: #{payload[:exception].inspect}" }
48
48
  end,
49
49
  ActiveSupport::Notifications.subscribe(/hermes_messenger_of_the_gods.endpoint.read_failure/) do |name, *_, payload|
50
- payload[:endpoint].error { "A message was received that could not be decoded: #{payload[:exception].message}" }
50
+ payload[:endpoint].say_error { "A message was received that could not be decoded: #{payload[:exception].message}" }
51
51
  end,
52
52
  ]
53
53
  end
@@ -1,3 +1,3 @@
1
1
  module HermesMessengerOfTheGods
2
- VERSION = '2.3.2'
2
+ VERSION = '2.3.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hermes_messenger_of_the_gods
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2
4
+ version: 2.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Malinconico