You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
479 B

  1. module Semantic
  2. module Subscribers
  3. # Abstract LogSubscriber
  4. class LogSubscriber
  5. attr_reader :logger, :event_group
  6. def initialize
  7. @event_group = self.class.name.demodulize.underscore.to_sym
  8. @logger = SemanticLogger[@event_group]
  9. end
  10. def any_hook(event)
  11. logger.warn(
  12. "#{@event_group} hook=<#{event.name.split('.')[0]}> needs a proper message handling!", event.payload.keys
  13. )
  14. end
  15. end
  16. end
  17. end