Class: Logfoo::Hutch::ErrorHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/logfoo/integrations/hutch.rb

Constant Summary collapse

ID =
'Hutch'.freeze

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeErrorHandler

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

.handlerObject

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_logObject (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_logObject (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(message_id, payload, consumer, ex)
  entry = ExceptionEntry.build(
    ID,
    ex,
    payload:    payload,
    consumer:   consumer,
    message_id: message_id
  )
  App.instance.append(entry)
end