Class: Rhelm::Client::SimpleLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/rhelm/client/simple_logger.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

LEVELS =
{ debug: 3, info: 2, warn: 1, error: 0 }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(level = :info) ⇒ SimpleLogger

Returns a new instance of SimpleLogger.

Raises:



7
8
9
10
# File 'lib/rhelm/client/simple_logger.rb', line 7

def initialize(level = :info)
  raise(Error, "unknown log level #{level}") unless LEVELS.key?(level)
  @level = LEVELS[level]
end

Instance Attribute Details

#levelObject

Returns the value of attribute level.



6
7
8
# File 'lib/rhelm/client/simple_logger.rb', line 6

def level
  @level
end