Optimize for the default case where TaggedLogger takes only one tag name

This commit is contained in:
Akira Matsuda 2022-12-17 16:58:39 +09:00
parent b9beb3eee1
commit 3baffd31be
No known key found for this signature in database

@ -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)