Class: LambdaPunch::Logger
- Inherits:
-
Object
- Object
- LambdaPunch::Logger
- Defined in:
- lib/lambda_punch/logger.rb
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
Instance Method Summary collapse
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
- #logger ⇒ Object
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
6 7 8 |
# File 'lib/lambda_punch/logger.rb', line 6 def initialize @level = (ENV['LAMBDA_PUNCH_LOG_LEVEL'] || 'error').upcase.to_sym end |
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level.
4 5 6 |
# File 'lib/lambda_punch/logger.rb', line 4 def level @level end |
Instance Method Details
#logger ⇒ Object
10 11 12 13 14 15 |
# File 'lib/lambda_punch/logger.rb', line 10 def logger @logger ||= ::Logger.new(STDOUT).tap do |l| l.level = logger_level l.formatter = proc { |_s, _d, _p, m| "[LambdaPunch] #{m}\n" } end end |