Class: BjnInventory::DefaultLogger

Inherits:
Logger
  • Object
show all
Defined in:
lib/bjn_inventory/default_logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(progname = 'bjn_inventory') ⇒ DefaultLogger

Returns a new instance of DefaultLogger.



7
8
9
10
11
12
13
14
15
# File 'lib/bjn_inventory/default_logger.rb', line 7

def initialize(progname='bjn_inventory')
    logger = Logger.new $stderr
    if ENV['BJN_INVENTORY_DEBUG'] and ! ENV['BJN_INVENTORY_DEBUG'].empty?
        logger.level = Logger::DEBUG
    else
        logger.level = Logger::WARN
    end
    logger
end