Class: Logfoo::Hutch::ErrorHandler
- Inherits:
-
Object
- Object
- Logfoo::Hutch::ErrorHandler
- Defined in:
- lib/logfoo/integrations/hutch.rb
Constant Summary collapse
- ID =
'Hutch'.freeze
Class Attribute Summary collapse
-
.handler ⇒ Object
Returns the value of attribute handler.
Instance Attribute Summary collapse
-
#bunny_log ⇒ Object
readonly
Returns the value of attribute bunny_log.
-
#hutch_log ⇒ Object
readonly
Returns the value of attribute hutch_log.
Instance Method Summary collapse
- #handle(message_id, payload, consumer, ex) ⇒ Object
-
#initialize ⇒ ErrorHandler
constructor
A new instance of ErrorHandler.
Constructor Details
#initialize ⇒ ErrorHandler
Returns a new instance of ErrorHandler.
13 14 15 16 17 |
# File 'lib/logfoo/integrations/hutch.rb', line 13 def initialize @hutch_log = Logfoo.get_logger(ID) @bunny_log = Logfoo.get_logger('Bunny') @bunny_log.level = Logfoo::WARN end |
Class Attribute Details
.handler ⇒ Object
Returns the value of attribute handler.
8 9 10 |
# File 'lib/logfoo/integrations/hutch.rb', line 8 def handler @handler end |
Instance Attribute Details
#bunny_log ⇒ Object (readonly)
Returns the value of attribute bunny_log.
5 6 7 |
# File 'lib/logfoo/integrations/hutch.rb', line 5 def bunny_log @bunny_log end |
#hutch_log ⇒ Object (readonly)
Returns the value of attribute hutch_log.
5 6 7 |
# File 'lib/logfoo/integrations/hutch.rb', line 5 def hutch_log @hutch_log end |
Instance Method Details
#handle(message_id, payload, consumer, ex) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/logfoo/integrations/hutch.rb', line 19 def handle(, payload, consumer, ex) entry = ExceptionEntry.build( ID, ex, payload: payload, consumer: consumer, message_id: ) App.instance.append(entry) end |