Module: Cisco::Logger

Defined in:
lib/cisco_node_utils/logger.rb

Overview

Module for logging in CiscoNodeUtils. Will automatically tie into Puppet or Chef logging modules if available.

Constant Summary collapse

@@logger =

rubocop:disable Style/ClassVars

Logger.new(STDOUT)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.debug(string) ⇒ Object



68
69
70
# File 'lib/cisco_node_utils/logger.rb', line 68

def debug(string)
  @@logger.debug(string)
end

.info(string) ⇒ Object



72
73
74
# File 'lib/cisco_node_utils/logger.rb', line 72

def info(string)
  @@logger.info(string)
end

Instance Method Details

#error(string) ⇒ Object



36
37
38
# File 'lib/cisco_node_utils/logger.rb', line 36

def error(string)
  @@logger.err(string)
end

#levelObject



50
51
52
# File 'lib/cisco_node_utils/logger.rb', line 50

def level
  @@logger.level
end

#level=(level) ⇒ Object



54
55
56
# File 'lib/cisco_node_utils/logger.rb', line 54

def level=(level)
  @@logger.level = level
end

#warn(string) ⇒ Object



40
41
42
# File 'lib/cisco_node_utils/logger.rb', line 40

def warn(string)
  @@logger.warning(string)
end