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.
12 13 14 15 16 |
# File 'lib/logfoo/integrations/hutch.rb', line 12 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.
7 8 9 |
# File 'lib/logfoo/integrations/hutch.rb', line 7 def handler @handler end |
Instance Attribute Details
#bunny_log ⇒ Object (readonly)
Returns the value of attribute bunny_log.
4 5 6 |
# File 'lib/logfoo/integrations/hutch.rb', line 4 def bunny_log @bunny_log end |
#hutch_log ⇒ Object (readonly)
Returns the value of attribute hutch_log.
4 5 6 |
# File 'lib/logfoo/integrations/hutch.rb', line 4 def hutch_log @hutch_log end |
Instance Method Details
#handle(message_id, payload, consumer, ex) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/logfoo/integrations/hutch.rb', line 18 def handle(, payload, consumer, ex) line = ErrLine.build( logger_name: ID, exception: ex, payload: (payload || {}).merge!( consumer: consumer, message_id: ) ) App.instance.append(line) end |