Class: RSpecTracer::Logger Private
- Inherits:
-
Object
- Object
- RSpecTracer::Logger
- Defined in:
- lib/rspec_tracer/logger.rb
Overview
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.
Internal Logger — see RSpecTracer for the user-facing surface. Internal logger; thin wrapper around ‘puts` gated on numeric log level. Exposed via `RSpecTracer.logger`.
Instance Method Summary collapse
-
#debug(message) ⇒ Object
private
Internal method on the tracer pipeline.
-
#error(message) ⇒ Object
private
Internal method on the tracer pipeline.
-
#info(message) ⇒ Object
private
Internal method on the tracer pipeline.
-
#initialize(log_level) ⇒ Logger
constructor
private
Internal method on the tracer pipeline.
-
#warn(message) ⇒ Object
private
Internal method on the tracer pipeline.
Constructor Details
#initialize(log_level) ⇒ Logger
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.
Internal method on the tracer pipeline.
12 13 14 |
# File 'lib/rspec_tracer/logger.rb', line 12 def initialize(log_level) @log_level = log_level end |
Instance Method Details
#debug(message) ⇒ 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.
Internal method on the tracer pipeline.
18 19 20 |
# File 'lib/rspec_tracer/logger.rb', line 18 def debug() puts if @log_level == 1 end |
#error(message) ⇒ 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.
Internal method on the tracer pipeline.
36 37 38 |
# File 'lib/rspec_tracer/logger.rb', line 36 def error() puts if @log_level.between?(1, 4) end |
#info(message) ⇒ 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.
Internal method on the tracer pipeline.
24 25 26 |
# File 'lib/rspec_tracer/logger.rb', line 24 def info() puts if @log_level.between?(1, 2) end |
#warn(message) ⇒ 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.
Internal method on the tracer pipeline.
30 31 32 |
# File 'lib/rspec_tracer/logger.rb', line 30 def warn() puts if @log_level.between?(1, 3) end |