Module: ActiveSupport::TaggedLogging::Formatter
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4/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(size = 1) ⇒ Object
- #push_tags(*tags) ⇒ 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 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb', line 31 def call(severity, , progname, msg) super(severity, , progname, "#{}#{msg}") end |
#clear_tags! ⇒ Object
53 54 55 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb', line 53 def .clear end |
#current_tags ⇒ Object
57 58 59 60 61 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb', line 57 def # We use our object ID here to avoid conflicting with other instances thread_key = @thread_key ||= "activesupport_tagged_logging_tags:#{object_id}" IsolatedExecutionState[thread_key] ||= [] end |
#pop_tags(size = 1) ⇒ Object
49 50 51 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb', line 49 def (size = 1) .pop size end |
#push_tags(*tags) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb', line 42 def (*) .flatten! .reject!(&:blank?) .concat end |
#tagged(*tags) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb', line 35 def tagged(*) = (*) yield self ensure (.size) end |
#tags_text ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb', line 63 def = if .one? "[#{[0]}] " elsif .any? .collect { |tag| "[#{tag}] " }.join end end |