Class: ActiveSupport::TaggedLogging::TagStack
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | activesupport/lib/active_support/tagged_logging.rb |
Class Method Summary
- .new ⇒ TagStack constructor
Instance Attribute Summary
- #tags readonly
Instance Method Summary
Constructor Details
.new ⇒ TagStack
# File 'activesupport/lib/active_support/tagged_logging.rb', line 73
def initialize @tags = [] @tags_string = nil end
Instance Attribute Details
#tags (readonly)
[ GitHub ]# File 'activesupport/lib/active_support/tagged_logging.rb', line 71
attr_reader :
Instance Method Details
#clear
[ GitHub ]# File 'activesupport/lib/active_support/tagged_logging.rb', line 91
def clear @tags_string = nil @tags.clear end
#format_message(message)
[ GitHub ]# File 'activesupport/lib/active_support/tagged_logging.rb', line 96
def ( ) if @tags.empty? elsif @tags.size == 1 "[#{@tags[0]}] #{}" else @tags_string ||= "[#{@tags.join("] [")}] " "#{@tags_string}#{}" end end
#pop_tags(count)
[ GitHub ]# File 'activesupport/lib/active_support/tagged_logging.rb', line 86
def (count) @tags_string = nil @tags.pop(count) end
#push_tags(tags)
[ GitHub ]# File 'activesupport/lib/active_support/tagged_logging.rb', line 78
def ( ) @tags_string = nil .flatten! .reject!(&:blank?) @tags.concat( ) end