Optimize for the default case where TaggedLogger takes only one tag name
This commit is contained in:
parent
b9beb3eee1
commit
3baffd31be
@ -33,7 +33,12 @@ def call(severity, timestamp, progname, msg)
|
||||
end
|
||||
|
||||
def tagged(*tags)
|
||||
new_tags = push_tags(*tags)
|
||||
new_tags = if tags.length == 1
|
||||
current_tags << tags[0] unless tags[0].blank?
|
||||
tags
|
||||
else
|
||||
push_tags(*tags)
|
||||
end
|
||||
yield self
|
||||
ensure
|
||||
pop_tags(new_tags.size)
|
||||
|
Loading…
Reference in New Issue
Block a user