Class: FeatureEnvy::Inspect::LoggerAdapter
- Inherits:
-
Object
- Object
- FeatureEnvy::Inspect::LoggerAdapter
- Defined in:
- lib/feature_envy/inspect.rb
Overview
An adapter class enabling the user of loggers for output.
output must respond to ‘#puts`, which precludes loggers. This adapter can be used to make loggers usable as outputs by logging at the desired level.
Instance Method Summary collapse
-
#initialize(logger, level: Logger::DEBUG) ⇒ LoggerAdapter
constructor
Initializes a new adapter for the specified logger.
- #puts(string) ⇒ Object private
Constructor Details
#initialize(logger, level: Logger::DEBUG) ⇒ LoggerAdapter
Initializes a new adapter for the specified logger.
212 213 214 215 |
# File 'lib/feature_envy/inspect.rb', line 212 def initialize logger, level: Logger::DEBUG @logger = logger @level = level end |
Instance Method Details
#puts(string) ⇒ 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.
218 219 220 221 |
# File 'lib/feature_envy/inspect.rb', line 218 def puts string @logger.add @level, string nil end |