Module: QuietLogger::Tagging Private
- Defined in:
- lib/quiet_logger.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Delegates the tagged logging API to the wrapped logger. This is only mixed into instances
that wrap a logger which supports tagging so that respond_to?(:tagged) continues to
advertise what the wrapped logger can actually do.
Instance Method Summary collapse
- #clear_tags! ⇒ Object private
- #pop_tags(count = 1) ⇒ Object private
- #push_tags(*tags) ⇒ Object private
-
#tagged(*tags) ⇒ Object
private
Add tags to the messages logged inside the block.
Instance Method Details
#clear_tags! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
67 68 69 |
# File 'lib/quiet_logger.rb', line 67 def @logger. end |
#pop_tags(count = 1) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
63 64 65 |
# File 'lib/quiet_logger.rb', line 63 def (count = 1) @logger.(count) end |
#push_tags(*tags) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
59 60 61 |
# File 'lib/quiet_logger.rb', line 59 def (*) @logger.(*) end |
#tagged(*tags) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Add tags to the messages logged inside the block. Tags are stored on the wrapped logger, so they are applied to messages logged with either logger.
51 52 53 54 55 56 57 |
# File 'lib/quiet_logger.rb', line 51 def tagged(*) if block_given? @logger.tagged(*) { yield self } else self.class.new(@logger.tagged(*), level: @level) end end |