lib/semlogr/events/log_event.rb in semlogr-0.2.2 vs lib/semlogr/events/log_event.rb in semlogr-0.2.3

- old
+ new

@@ -1,5 +1,6 @@ +require 'digest/xxhash' require 'semlogr/templates/parser' module Semlogr module Events class LogEvent @@ -35,9 +36,13 @@ @properties.merge!(properties) { |_, old, _| old } end def render(output) @template.render(output, @properties) + end + + def type + @type ||= Digest::XXH32.hexdigest(@template.text) end def to_s output = ''