Module: Etcd::Loggable

Included in:
Client, Cluster, Heartbeat, Observer, Requestable
Defined in:
lib/etcd/loggable.rb

Instance Method Summary collapse

Instance Method Details

#logger(level = Logger::WARN) ⇒ Object


2
3
4
# File 'lib/etcd/loggable.rb', line 2

def logger(level=Logger::WARN)
  @logger ||= reset_logger!(level)
end

#reset_logger!(level = Logger::WARN) ⇒ Object


6
7
8
9
10
11
12
# File 'lib/etcd/loggable.rb', line 6

def reset_logger!(level=Logger::WARN)
  @logger = begin
    log       = Logger.new(STDOUT)
    log.level = level
    log
  end
end