Class: NatsWork::ErrorNotifiers::LogNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/natswork/error_tracker.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger = nil) ⇒ LogNotifier

Returns a new instance of LogNotifier.



280
281
282
# File 'lib/natswork/error_tracker.rb', line 280

def initialize(logger = nil)
  @logger = logger || NatsWork::Logger.global
end

Instance Method Details

#call(error_info) ⇒ Object



284
285
286
287
288
289
290
# File 'lib/natswork/error_tracker.rb', line 284

def call(error_info)
  @logger.error('Error tracked',
                error_key: "#{error_info[:type]}:#{error_info[:fingerprint]}",
                error_type: error_info[:type],
                error_message: error_info[:message],
                context: error_info[:context])
end