Class: ElasticAPM::PrefixedLogger Private
- Inherits:
-
Logger
- Object
- Logger
- ElasticAPM::PrefixedLogger
- Defined in:
- lib/elastic_apm/util/prefixed_logger.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #prefix ⇒ Object readonly private
Instance Method Summary collapse
- #add(severity, message = nil, progname = nil, &block) ⇒ Object private
-
#initialize(logdev, prefix: '', **args) ⇒ PrefixedLogger
constructor
private
A new instance of PrefixedLogger.
Constructor Details
#initialize(logdev, prefix: '', **args) ⇒ PrefixedLogger
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.
Returns a new instance of PrefixedLogger.
6 7 8 9 10 |
# File 'lib/elastic_apm/util/prefixed_logger.rb', line 6 def initialize(logdev, prefix: '', **args) super(logdev, **args) @prefix = prefix end |
Instance Attribute Details
#prefix ⇒ Object (readonly)
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.
12 13 14 |
# File 'lib/elastic_apm/util/prefixed_logger.rb', line 12 def prefix @prefix end |
Instance Method Details
#add(severity, message = nil, progname = nil, &block) ⇒ 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.
14 15 16 |
# File 'lib/elastic_apm/util/prefixed_logger.rb', line 14 def add(severity, = nil, progname = nil, &block) super(severity, , format('%s%s', prefix, progname), &block) end |