提交 c3913e58 编写于 作者: E Eugene Kenny

Revert "Cache tags_text to avoid computing tags each time when logging"

This reverts commit 05060ddb.

Tags are per-fiber, so they can't be cached in an instance variable.
上级 86480e71
......@@ -40,7 +40,6 @@ def tagged(*tags)
end
def push_tags(*tags)
@tags_text = nil
tags.flatten!
tags.reject!(&:blank?)
current_tags.concat tags
......@@ -48,12 +47,10 @@ def push_tags(*tags)
end
def pop_tags(size = 1)
@tags_text = nil
current_tags.pop size
end
def clear_tags!
@tags_text = nil
current_tags.clear
end
......@@ -64,13 +61,11 @@ def current_tags
end
def tags_text
@tags_text ||= begin
tags = current_tags
if tags.one?
"[#{tags[0]}] "
elsif tags.any?
tags.collect { |tag| "[#{tag}] " }.join
end
tags = current_tags
if tags.one?
"[#{tags[0]}] "
elsif tags.any?
tags.collect { |tag| "[#{tag}] " }.join
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册