Class: NextStation::Logging::Subscribers::Custom Private

Inherits:
Base
  • Object
show all
Defined in:
lib/next_station/logging/subscribers/custom.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Subscriber for custom log events manually triggered.

Constant Summary

Constants inherited from Base

Base::LEVELS

Instance Method Summary collapse

Methods inherited from Base

subscribe

Instance Method Details

#on_custom(event) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • event (Dry::Monitor::Event)


17
18
19
20
21
# File 'lib/next_station/logging/subscribers/custom.rb', line 17

def on_custom(event)
  log_event(event, extra_data: {
    event_kind: 'log.custom'
  })
end

#subscribe(monitor) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • monitor (Dry::Monitor::Notifications)


12
13
14
# File 'lib/next_station/logging/subscribers/custom.rb', line 12

def subscribe(monitor)
  monitor.subscribe('log.custom') { |event| on_custom(event) }
end