123456789_123456789_123456789_123456789_123456789_

Module: ActiveSupport::TaggedLogging::Formatter

Do not use. This module is for internal use only.
Relationships & Source Files
Defined in: activesupport/lib/active_support/tagged_logging.rb

Instance Method Summary

Instance Method Details

#call(severity, timestamp, progname, msg)

This method is invoked when a log event occurs.

[ GitHub ]

  
# File 'activesupport/lib/active_support/tagged_logging.rb', line 33

def call(severity, timestamp, progname, msg)
  super(severity, timestamp, progname, tag_stack.format_message(msg))
end

#clear_tags!

[ GitHub ]

  
# File 'activesupport/lib/active_support/tagged_logging.rb', line 52

def clear_tags!
  tag_stack.clear
end

#current_tags

[ GitHub ]

  
# File 'activesupport/lib/active_support/tagged_logging.rb', line 62

def current_tags
  tag_stack.tags
end

#pop_tags(count = 1)

[ GitHub ]

  
# File 'activesupport/lib/active_support/tagged_logging.rb', line 48

def pop_tags(count = 1)
  tag_stack.pop_tags(count)
end

#push_tags(*tags)

[ GitHub ]

  
# File 'activesupport/lib/active_support/tagged_logging.rb', line 44

def push_tags(*tags)
  tag_stack.push_tags(tags)
end

#tag_stack

[ GitHub ]

  
# File 'activesupport/lib/active_support/tagged_logging.rb', line 56

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)

[ GitHub ]

  
# File 'activesupport/lib/active_support/tagged_logging.rb', line 37

def tagged(*tags)
  pushed_count = tag_stack.push_tags(tags).size
  yield self
ensure
  pop_tags(pushed_count)
end

#tags_text

[ GitHub ]

  
# File 'activesupport/lib/active_support/tagged_logging.rb', line 66

def tags_text
  tag_stack.format_message("")
end