lib/logster/base_store.rb in logster-1.3.4 vs lib/logster/base_store.rb in logster-1.4.0.pre
- old
+ new
@@ -1,6 +1,5 @@
-
module Logster
class BaseStore
attr_accessor :level, :max_retention, :skip_empty, :ignore
@@ -77,16 +76,15 @@
def report(severity, progname, msg, opts = {})
return if (!msg || (String === msg && msg.empty?)) && skip_empty
return if level && severity < level
- message = Logster::Message.new(severity, progname, msg, opts[:timestamp])
+ message = Logster::Message.new(severity, progname, msg, opts[:timestamp], count: opts[:count])
env = opts[:env] || {}
backtrace = opts[:backtrace]
-
- if env[:backtrace]
+ if Hash === env && env[:backtrace]
# Special - passing backtrace through env
backtrace = env.delete(:backtrace)
end
message.populate_from_env(env)
@@ -108,10 +106,9 @@
key = self.similar_key(message)
similar = get key if key
end
if similar
- similar.count += 1
similar.merge_similar_message(message)
replace_and_bump similar
similar
else