Module: ZK::Logger

Overview

use the ZK.logger if non-nil (to allow users to override the logger) otherwise, use a Loggging logger based on the class name

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.wrapped_loggerObject



5
6
7
8
9
10
11
# File 'lib/zk/logger.rb', line 5

def self.wrapped_logger
  if defined?(@@wrapped_logger)
    @@wrapped_logger
  else
    @@wrapped_logger = ::Logger.new(STDERR).tap { |l| l.level = ::Logger::FATAL }
  end
end

.wrapped_logger=(log) ⇒ Object



13
14
15
# File 'lib/zk/logger.rb', line 13

def self.wrapped_logger=(log)
  @@wrapped_logger = log
end

Instance Method Details

#loggerObject



29
30
31
# File 'lib/zk/logger.rb', line 29

def logger
  @logger ||= (::ZK.logger || self.class.logger)
end