lib/timber/events/custom.rb in timber-2.6.1 vs lib/timber/events/custom.rb in timber-2.6.2

- old
+ new

@@ -25,11 +25,11 @@ def initialize(attributes) normalizer = Util::AttributeNormalizer.new(attributes) @type = normalizer.fetch!(:type, :symbol) @message = normalizer.fetch!(:message, :string) - data = normalizer.fetch!(:data, :hash) + data = normalizer.fetch(:data, :hash, default: {}) if !data.nil? && data[:time_ms].is_a?(Time) data[:time_ms] = Timer.duration_ms(data[:time_ms]) @message << " in #{data[:time_ms]}ms" end @@ -48,6 +48,6 @@ def as_json(_options = {}) {:custom => to_hash} end end end -end \ No newline at end of file +end