Class: AWS::CloudFormation::Helper::Logger
- Inherits:
-
Object
- Object
- AWS::CloudFormation::Helper::Logger
- Defined in:
- lib/aws_cloudformation_helper/logger.rb
Overview
Main class to handle logging
Constant Summary collapse
- DEFAULT_LOG_LEVEL =
:info
Instance Attribute Summary collapse
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Instance Method Summary collapse
- #debug(msg) ⇒ Object
- #error(msg) ⇒ Object
- #info(msg) ⇒ Object
-
#initialize(log_level = nil, stdout = STDOUT, stderr = STDERR) ⇒ Logger
constructor
A new instance of Logger.
- #warn(msg) ⇒ Object
Constructor Details
#initialize(log_level = nil, stdout = STDOUT, stderr = STDERR) ⇒ Logger
Returns a new instance of Logger.
17 18 19 20 21 22 |
# File 'lib/aws_cloudformation_helper/logger.rb', line 17 def initialize(log_level = nil, stdout = STDOUT, stderr = STDERR) @log_level = DEFAULT_LOG_LEVEL @log_level = log_level unless log_level.nil? @stdout = stdout @stderr = stderr end |
Instance Attribute Details
#log_level ⇒ Object
Returns the value of attribute log_level.
13 14 15 |
# File 'lib/aws_cloudformation_helper/logger.rb', line 13 def log_level @log_level end |
#stderr ⇒ Object
Returns the value of attribute stderr.
15 16 17 |
# File 'lib/aws_cloudformation_helper/logger.rb', line 15 def stderr @stderr end |
#stdout ⇒ Object
Returns the value of attribute stdout.
14 15 16 |
# File 'lib/aws_cloudformation_helper/logger.rb', line 14 def stdout @stdout end |
Instance Method Details
#debug(msg) ⇒ Object
36 37 38 |
# File 'lib/aws_cloudformation_helper/logger.rb', line 36 def debug(msg) logger.debug(msg) end |
#error(msg) ⇒ Object
24 25 26 |
# File 'lib/aws_cloudformation_helper/logger.rb', line 24 def error(msg) error_logger.error(msg) end |
#info(msg) ⇒ Object
28 29 30 |
# File 'lib/aws_cloudformation_helper/logger.rb', line 28 def info(msg) logger.info(msg) end |
#warn(msg) ⇒ Object
32 33 34 |
# File 'lib/aws_cloudformation_helper/logger.rb', line 32 def warn(msg) logger.warn(msg) end |