Module: LogStashLogger::TaggedLogging::Formatter
- Included in:
- Formatter::Base
- Defined in:
- lib/logstash-logger/tagged_logging.rb
Instance Method Summary collapse
- #clear_tags! ⇒ Object
- #current_tags ⇒ Object
- #pop_tags(size = 1) ⇒ Object
- #push_tags(*tags) ⇒ Object
- #tagged(*tags) ⇒ Object
Instance Method Details
#clear_tags! ⇒ Object
33 34 35 |
# File 'lib/logstash-logger/tagged_logging.rb', line 33 def .clear end |
#current_tags ⇒ Object
37 38 39 |
# File 'lib/logstash-logger/tagged_logging.rb', line 37 def Thread.current[:logstash_logger_tags] ||= [] end |
#pop_tags(size = 1) ⇒ Object
29 30 31 |
# File 'lib/logstash-logger/tagged_logging.rb', line 29 def (size = 1) .pop size end |
#push_tags(*tags) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/logstash-logger/tagged_logging.rb', line 21 def (*) = .flatten.compact.reject { |t| t.respond_to?(:empty?) && t.empty? } .tap do || .concat end end |
#tagged(*tags) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/logstash-logger/tagged_logging.rb', line 14 def tagged(*) = (*) yield self ensure (.size) end |