Module: Logging
- Included in:
- CfnGuardian::Cli, CfnGuardian::CloudWatch, CfnGuardian::CodeCommit, CfnGuardian::CodePipeline, CfnGuardian::Compile, CfnGuardian::Deploy, CfnGuardian::Resource::Base, CfnGuardian::S3, CfnGuardian::Stacks::Main, CfnGuardian::Tagger, CfnGuardian::Validate
- Defined in:
- lib/cfnguardian/log.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.colors ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/cfnguardian/log.rb', line 5 def colors @colors ||= { ERROR: 31, # red WARN: 33, # yellow INFO: 0, DEBUG: 32 # green } end |
.included(base) ⇒ Object
Addition
28 29 30 31 32 33 34 |
# File 'lib/cfnguardian/log.rb', line 28 def self.included(base) class << base def logger Logging.logger end end end |
.logger ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/cfnguardian/log.rb', line 14 def logger @logger ||= Logger.new($stdout) @logger.formatter = proc do |severity, datetime, progname, msg| "\e[#{colors[severity.to_sym]}m#{severity}: #{msg}\e[0m\n" end @logger end |
.logger=(logger) ⇒ Object
22 23 24 |
# File 'lib/cfnguardian/log.rb', line 22 def logger=(logger) @logger = logger end |