lib/timber/logger.rb in timber-2.1.0.rc3 vs lib/timber/logger.rb in timber-2.1.0.rc4
- old
+ new
@@ -90,12 +90,12 @@
LogEntry.new(level, time, progname, logged_obj.message, context_snapshot, logged_obj,
tags: tags)
elsif logged_obj.is_a?(Hash)
# Extract the tags
tags = tags.clone
- tags << logged_obj.delete(:tag) if logged_obj.key?(:tag)
- tags += logged_obj.delete(:tags) if logged_obj.key?(:tags)
+ tags.push(logged_obj.delete(:tag)) if logged_obj.key?(:tag)
+ tags.concat(logged_obj.delete(:tags)) if logged_obj.key?(:tags)
tags.uniq!
# Extract the time_ms
time_ms = logged_obj.delete(:time_ms)
@@ -111,11 +111,15 @@
end
# Because of all the crazy ways Rails has attempted tags, we need this crazy method.
def extract_active_support_tagged_logging_tags
Thread.current[:activesupport_tagged_logging_tags] ||
- Thread.current["activesupport_tagged_logging_tags:#{object_id}"] ||
+ Thread.current[tagged_logging_object_key_name] ||
EMPTY_ARRAY
+ end
+
+ def tagged_logging_object_key_name
+ @tagged_logging_object_key_name ||= "activesupport_tagged_logging_tags:#{object_id}"
end
end
# For use in development and test environments where you do not want metadata
# included in the log lines.
\ No newline at end of file