Skip to content

Commit

Permalink
Support TaggedLogging in Rails 7.1 (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrHeinz authored Aug 4, 2023
1 parent 6190e43 commit 35d7c4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/logtail/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def build_log_entry(severity, time, progname, logged_obj)

# Because of all the crazy ways Rails has attempted tags, we need this crazy method.
def extract_active_support_tagged_logging_tags
if defined?(ActiveSupport::IsolatedExecutionState)
@current_tags ||= ActiveSupport::IsolatedExecutionState[tagged_logging_object_key_name]
if defined?(current_tags)
return current_tags
end

@current_tags ||
defined?(ActiveSupport::IsolatedExecutionState) && ActiveSupport::IsolatedExecutionState[tagged_logging_object_key_name] ||
Thread.current[:activesupport_tagged_logging_tags] ||
Thread.current[tagged_logging_object_key_name] ||
EMPTY_ARRAY
Expand Down
2 changes: 1 addition & 1 deletion lib/logtail/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Logtail
VERSION = "0.1.10"
VERSION = "0.1.11"
end

0 comments on commit 35d7c4a

Please sign in to comment.