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
31 32 33 |
# File 'lib/logstash-logger/tagged_logging.rb', line 31 def .clear end |
#current_tags ⇒ Object
35 36 37 |
# File 'lib/logstash-logger/tagged_logging.rb', line 35 def Thread.current[:logstash_logger_tags] ||= [] end |
#pop_tags(size = 1) ⇒ Object
27 28 29 |
# File 'lib/logstash-logger/tagged_logging.rb', line 27 def (size = 1) .pop size end |
#push_tags(*tags) ⇒ Object
21 22 23 24 25 |
# File 'lib/logstash-logger/tagged_logging.rb', line 21 def (*) .flatten.reject(&: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 |