Skip to content

Commit

Permalink
Replace Thread#[] with Thread#thread_variable_get/set
Browse files Browse the repository at this point in the history
  • Loading branch information
milgner committed Mar 18, 2018
1 parent 43f3d4e commit 73e3838
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/gelf/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def push_tags(*tags)
end

def current_tags
Thread.current[:gelf_tagged_logging_tags] ||= []
val = Thread.current.thread_variable_get(:gelf_tagged_logging_tags)
return val unless val.nil?
Thread.current.thread_variable_set(:gelf_tagged_logging_tags, [])
end
end

Expand Down

0 comments on commit 73e3838

Please sign in to comment.