Class: CzechPostB2bClient::Logger
- Inherits:
-
Object
- Object
- CzechPostB2bClient::Logger
- Defined in:
- lib/czech_post_b2b_client/logger.rb
Constant Summary collapse
- LEVELS =
{ debug: 0, info: 1, error: 2 }.freeze
Instance Attribute Summary collapse
-
#min_log_level ⇒ Object
readonly
Returns the value of attribute min_log_level.
-
#target_logger ⇒ Object
readonly
Returns the value of attribute target_logger.
Instance Method Summary collapse
-
#initialize(configuration) ⇒ Logger
constructor
A new instance of Logger.
- #log(original_level, message) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ Logger
Returns a new instance of Logger.
11 12 13 14 |
# File 'lib/czech_post_b2b_client/logger.rb', line 11 def initialize(configuration) @target_logger = configuration.logger @min_log_level = configuration. end |
Instance Attribute Details
#min_log_level ⇒ Object (readonly)
Returns the value of attribute min_log_level.
7 8 9 |
# File 'lib/czech_post_b2b_client/logger.rb', line 7 def min_log_level @min_log_level end |
#target_logger ⇒ Object (readonly)
Returns the value of attribute target_logger.
7 8 9 |
# File 'lib/czech_post_b2b_client/logger.rb', line 7 def target_logger @target_logger end |
Instance Method Details
#log(original_level, message) ⇒ Object
16 17 18 |
# File 'lib/czech_post_b2b_client/logger.rb', line 16 def log(original_level, ) target_logger.send(modified_log_level(original_level), ) end |