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


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

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

.info(string) ⇒ Object


75
76
77
# File 'lib/cisco_node_utils/logger.rb', line 75

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


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

def level
  @@logger.level
end

#level=(level) ⇒ Object


57
58
59
# File 'lib/cisco_node_utils/logger.rb', line 57

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