Class: Klogger::TaggedLogger
- Inherits:
-
Object
- Object
- Klogger::TaggedLogger
- Defined in:
- lib/klogger/tagged_logger.rb
Instance Method Summary collapse
- #add_group(**tags) ⇒ Object
- #create_tagged_logger(**tags) ⇒ Object
- #exception(exception, message = nil, **tags) ⇒ Object
- #group(**tags, &block) ⇒ Object
-
#initialize(parent, **tags) ⇒ TaggedLogger
constructor
A new instance of TaggedLogger.
- #pop_group ⇒ Object
- #silence!(&block) ⇒ Object
- #silenced? ⇒ Boolean
- #tagged(**tags, &block) ⇒ Object
- #unsilence!(&block) ⇒ Object
Constructor Details
#initialize(parent, **tags) ⇒ TaggedLogger
Returns a new instance of TaggedLogger.
8 9 10 11 |
# File 'lib/klogger/tagged_logger.rb', line 8 def initialize(parent, **) @parent = parent @tags = end |
Instance Method Details
#add_group(**tags) ⇒ Object
27 28 29 |
# File 'lib/klogger/tagged_logger.rb', line 27 def add_group(**) @parent.add_group(**@tags.merge()) end |
#create_tagged_logger(**tags) ⇒ Object
51 52 53 |
# File 'lib/klogger/tagged_logger.rb', line 51 def create_tagged_logger(**) @parent.create_tagged_logger(**@tags.merge()) end |
#exception(exception, message = nil, **tags) ⇒ Object
19 20 21 |
# File 'lib/klogger/tagged_logger.rb', line 19 def exception(exception, = nil, **) @parent.exception(exception, , **@tags.merge()) end |
#group(**tags, &block) ⇒ Object
23 24 25 |
# File 'lib/klogger/tagged_logger.rb', line 23 def group(**, &block) @parent.group(**@tags.merge(), &block) end |
#pop_group ⇒ Object
31 32 33 |
# File 'lib/klogger/tagged_logger.rb', line 31 def pop_group @parent.pop_group end |
#silence!(&block) ⇒ Object
39 40 41 |
# File 'lib/klogger/tagged_logger.rb', line 39 def silence!(&block) @parent.silence!(&block) end |
#silenced? ⇒ Boolean
47 48 49 |
# File 'lib/klogger/tagged_logger.rb', line 47 def silenced? @parent.silenced? end |
#tagged(**tags, &block) ⇒ Object
35 36 37 |
# File 'lib/klogger/tagged_logger.rb', line 35 def tagged(**, &block) @parent.tagged(**@tags.merge(), &block) end |
#unsilence!(&block) ⇒ Object
43 44 45 |
# File 'lib/klogger/tagged_logger.rb', line 43 def unsilence!(&block) @parent.unsilence!(&block) end |