Class: AMQP::Failover::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/amqp/failover/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled = nil) ⇒ Logger

Returns a new instance of Logger.



9
10
11
# File 'lib/amqp/failover/logger.rb', line 9

def initialize(enabled = nil)
  @enabled = enabled || true
end

Instance Attribute Details

#enabledObject

Returns the value of attribute enabled.



7
8
9
# File 'lib/amqp/failover/logger.rb', line 7

def enabled
  @enabled
end

Instance Method Details

#error(*msg) ⇒ Object



13
14
15
16
# File 'lib/amqp/failover/logger.rb', line 13

def error(*msg)
  msg[0] = "[ERROR]: " + msg[0] if msg[0].is_a?(String)
  write(*msg)
end

#info(*msg) ⇒ Object



18
19
20
# File 'lib/amqp/failover/logger.rb', line 18

def info(*msg)
  write(*msg)
end