Module: EvilEvents::Core::Events::Notifier::Logging Private

Included in:
Sequential, Worker::Executor
Defined in:
lib/evil_events/core/events/notifier/logging.rb

Overview

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

Since:

  • 0.3.0

Instance Method Summary collapse

Instance Method Details

#log_activity(event, subscriber, status) ⇒ Object (private)

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.

Returns void.

Parameters:

Returns:

  • void

Since:

  • 0.3.0



35
36
37
38
39
40
41
42
# File 'lib/evil_events/core/events/notifier/logging.rb', line 35

def log_activity(event, subscriber, status)
  activity = "EventProcessed(#{event.type})"
  message  = "EVENT_ID: #{event.id} :: " \
             "STATUS: #{status} :: " \
             "SUBSCRIBER: #{subscriber.source_object}"

  EvilEvents::Core::ActivityLogger.log(activity: activity, message: message)
end

#log_failure(event, subscriber) ⇒ 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.

Returns void.

Parameters:

Returns:

  • void

Since:

  • 0.3.0



12
13
14
# File 'lib/evil_events/core/events/notifier/logging.rb', line 12

def log_failure(event, subscriber)
  log_activity(event, subscriber, :failed)
end

#log_success(event, subscriber) ⇒ 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.

Returns void.

Parameters:

Returns:

  • void

Since:

  • 0.3.0



22
23
24
# File 'lib/evil_events/core/events/notifier/logging.rb', line 22

def log_success(event, subscriber)
  log_activity(event, subscriber, :successful)
end