Class: RightSupport::Log::StepLevelLogger

Inherits:
FilterLogger show all
Defined in:
lib/right_support/log/step_level_logger.rb

Overview

a decorator that provides a step-level filter such that it can decorate a logger of more detailed level while allowing only messages of a less detailed level. for example, a logger can be associated with a database and omit debug-level messages from the db driver while allowing any errors, warnings, etc. to pass through to the web application logger. this allows for a unified log with specific level filtering for specific use cases.

setting log level on this kind of logger does not set the level of the underlying logger (hence the name step-level).

Constant Summary

Constants inherited from FilterLogger

FilterLogger::SEVERITY_TO_METHOD

Instance Attribute Summary collapse

Attributes inherited from FilterLogger

#actual_logger

Instance Method Summary collapse

Methods inherited from FilterLogger

#<<, #add, #close, #debug, #debug?, #error, #error?, #fatal, #fatal?, #info, #info?, #method_missing, #respond_to?, #warn, #warn?

Constructor Details

#initialize(*args) ⇒ StepLevelLogger

Returns a new instance of StepLevelLogger.



37
38
39
40
# File 'lib/right_support/log/step_level_logger.rb', line 37

def initialize(*args)
  super
  @level = ::Logger::DEBUG
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightSupport::Log::FilterLogger

Instance Attribute Details

#levelObject

declare accessor to prevent setting decorated logger level



35
36
37
# File 'lib/right_support/log/step_level_logger.rb', line 35

def level
  @level
end