Class: AMQP::Failover::Logger
- Inherits:
-
Object
- Object
- AMQP::Failover::Logger
- Defined in:
- lib/amqp/failover/logger.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
Instance Method Summary collapse
- #error(*msg) ⇒ Object
- #info(*msg) ⇒ Object
-
#initialize(enabled = nil) ⇒ Logger
constructor
A new instance of Logger.
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
#enabled ⇒ Object
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 |