Class: NatsWork::ErrorNotifiers::LogNotifier
- Inherits:
-
Object
- Object
- NatsWork::ErrorNotifiers::LogNotifier
- Defined in:
- lib/natswork/error_tracker.rb
Instance Method Summary collapse
- #call(error_info) ⇒ Object
-
#initialize(logger = nil) ⇒ LogNotifier
constructor
A new instance of LogNotifier.
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 |