Module: Logging

Included in:
TogglV8::Connection
Defined in:
lib/logging.rb

Overview

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Addition



18
19
20
21
22
23
24
# File 'lib/logging.rb', line 18

def self.included(base)
  class << base
    def logger
      Logging.logger
    end
  end
end

.loggerObject



8
9
10
# File 'lib/logging.rb', line 8

def logger
  @logger ||= Logger.new($stdout)
end

.logger=(logger) ⇒ Object



12
13
14
# File 'lib/logging.rb', line 12

def logger=(logger)
  @logger = logger
end

Instance Method Details

#debug(debug = true) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/logging.rb', line 30

def debug(debug=true)
  if debug
    logger.level = Logger::DEBUG
  else
    logger.level = Logger::WARN
  end
end

#loggerObject



26
27
28
# File 'lib/logging.rb', line 26

def logger
  Logging.logger
end