lib/mihari/emitters/base.rb in mihari-7.1.1 vs lib/mihari/emitters/base.rb in mihari-7.1.2

- old
+ new

@@ -17,11 +17,19 @@ super(options: options) @rule = rule end + # A target to emit the data # + # @return [String] + # + def target + raise NotImplementedError, "You must implement #{self.class}##{__method__}" + end + + # # @param [Array<Mihari::Models::Artifact>] artifacts # def call(artifacts) raise NotImplementedError, "You must implement #{self.class}##{__method__}" end @@ -36,10 +44,12 @@ interval: retry_interval, exponential_backoff: retry_exponential_backoff ) { call(artifacts) } end.to_result - Mihari.logger.warn("Emitter:#{self.class.class_key} failed - #{result.failure}") if result.failure? + if result.failure? + Mihari.logger.warn("Emitter:#{self.class.key} for #{target.truncate(32)} failed - #{result.failure}") + end result end class << self