Module: ActiveSupport::TaggedLogging::Formatter
- Defined in:
- activesupport/lib/active_support/tagged_logging.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#call(severity, timestamp, progname, msg) ⇒ Object
This method is invoked when a log event occurs.
- #clear_tags! ⇒ Object
- #current_tags ⇒ Object
- #pop_tags(count = 1) ⇒ Object
- #push_tags(*tags) ⇒ Object
- #tag_stack ⇒ Object
- #tagged(*tags) ⇒ Object
- #tags_text ⇒ Object
Instance Method Details
#call(severity, timestamp, progname, msg) ⇒ Object
This method is invoked when a log event occurs.
31 32 33 |
# File 'activesupport/lib/active_support/tagged_logging.rb', line 31 def call(severity, , progname, msg) super(severity, , progname, tag_stack.(msg)) end |
#clear_tags! ⇒ Object
50 51 52 |
# File 'activesupport/lib/active_support/tagged_logging.rb', line 50 def tag_stack.clear end |
#current_tags ⇒ Object
60 61 62 |
# File 'activesupport/lib/active_support/tagged_logging.rb', line 60 def tag_stack. end |
#pop_tags(count = 1) ⇒ Object
46 47 48 |
# File 'activesupport/lib/active_support/tagged_logging.rb', line 46 def (count = 1) tag_stack.(count) end |
#push_tags(*tags) ⇒ Object
42 43 44 |
# File 'activesupport/lib/active_support/tagged_logging.rb', line 42 def (*) tag_stack.() end |
#tag_stack ⇒ Object
54 55 56 57 58 |
# File 'activesupport/lib/active_support/tagged_logging.rb', line 54 def tag_stack # We use our object ID here to avoid conflicting with other instances @thread_key ||= "activesupport_tagged_logging_tags:#{object_id}" IsolatedExecutionState[@thread_key] ||= TagStack.new end |
#tagged(*tags) ⇒ Object
35 36 37 38 39 40 |
# File 'activesupport/lib/active_support/tagged_logging.rb', line 35 def tagged(*) pushed_count = tag_stack.().size yield self ensure (pushed_count) end |
#tags_text ⇒ Object
64 65 66 |
# File 'activesupport/lib/active_support/tagged_logging.rb', line 64 def tag_stack.("") end |