Module: InvisibleHand

Defined in:
lib/invisiblehand.rb,
lib/invisiblehand/api.rb,
lib/invisiblehand/page.rb,
lib/invisiblehand/errors.rb,
lib/invisiblehand/logger.rb,
lib/invisiblehand/product.rb,
lib/invisiblehand/version.rb,
lib/invisiblehand/response.rb

Defined Under Namespace

Modules: Error, Logger Classes: API, Page, Product, Response

Constant Summary collapse

DEBUG =
!!ENV['DEBUG']
VERSION =
"0.2"

Class Method Summary collapse

Class Method Details

.loggerObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/invisiblehand/logger.rb', line 2

def self.logger
  unless @logger
    @logger = ::Logger.new(STDOUT)

    if DEBUG
      @logger.level = ::Logger::DEBUG
    else
      @logger.level = ::Logger::FATAL
    end
  end

  @logger
end

.logger=(new_logger) ⇒ Object

Override the InvisibleHand logger if you wish to have finer grained control over where your application’s output is going.

InvisibleHand.logger = Logger.new('my/app/logs.log')


20
21
22
# File 'lib/invisiblehand/logger.rb', line 20

def self.logger= new_logger
  @logger = new_logger
end