Class: ComplianceEngine::PuppetLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/compliance_engine/puppet_logger.rb

Overview

Routes ComplianceEngine log messages through Puppet’s logging system. Used as a drop-in replacement for the default Logger when running inside Puppet.

Instance Method Summary collapse

Constructor Details

#initialize(*_args, **_kwargs) ⇒ PuppetLogger

Returns a new instance of PuppetLogger.



7
8
9
# File 'lib/compliance_engine/puppet_logger.rb', line 7

def initialize(*_args, **_kwargs)
  ensure_puppet_available!
end

Instance Method Details

#debug(msg) ⇒ Object



11
12
13
14
# File 'lib/compliance_engine/puppet_logger.rb', line 11

def debug(msg)
  ensure_puppet_available!
  ::Puppet.debug(msg)
end

#error(msg) ⇒ Object



26
27
28
29
# File 'lib/compliance_engine/puppet_logger.rb', line 26

def error(msg)
  ensure_puppet_available!
  ::Puppet.err(msg)
end

#fatal(msg) ⇒ Object



31
32
33
34
# File 'lib/compliance_engine/puppet_logger.rb', line 31

def fatal(msg)
  ensure_puppet_available!
  ::Puppet.crit(msg)
end

#info(msg) ⇒ Object



16
17
18
19
# File 'lib/compliance_engine/puppet_logger.rb', line 16

def info(msg)
  ensure_puppet_available!
  ::Puppet.info(msg)
end

#levelObject



36
# File 'lib/compliance_engine/puppet_logger.rb', line 36

def level; end

#level=(_val) ⇒ Object



38
# File 'lib/compliance_engine/puppet_logger.rb', line 38

def level=(_val); end

#warn(msg) ⇒ Object



21
22
23
24
# File 'lib/compliance_engine/puppet_logger.rb', line 21

def warn(msg)
  ensure_puppet_available!
  ::Puppet.warning(msg)
end