Class: Aws::Embedded::Metrics::Sinks::Logger
- Inherits:
-
Object
- Object
- Aws::Embedded::Metrics::Sinks::Logger
- Defined in:
- lib/aws-embedded-metrics-customink/sinks/logger.rb
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #accept(message) ⇒ Object
-
#initialize(logger, level: :info) ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize(logger, level: :info) ⇒ Logger
Returns a new instance of Logger.
9 10 11 12 |
# File 'lib/aws-embedded-metrics-customink/sinks/logger.rb', line 9 def initialize(logger, level: :info) @logger = logger @level = level.to_sym end |
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level.
7 8 9 |
# File 'lib/aws-embedded-metrics-customink/sinks/logger.rb', line 7 def level @level end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
7 8 9 |
# File 'lib/aws-embedded-metrics-customink/sinks/logger.rb', line 7 def logger @logger end |
Instance Method Details
#accept(message) ⇒ Object
14 15 16 |
# File 'lib/aws-embedded-metrics-customink/sinks/logger.rb', line 14 def accept() logger.public_send(level, JSON.dump()) end |