Sha256: 0b2948c90d60c5d25945b8cb37b5a26a70898177fadffdaebbf88677bedba289

Contents?: true

Size: 570 Bytes

Versions: 3

Compression:

Stored size: 570 Bytes

Contents

require 'logger'

module Logging
	
	attr_accessor :logger, :current_log_device
	
	def initialize
		super()
		create_logger(STDOUT, Logger::INFO)
	end
	
	def log_device=(logdev)
		level = @logger.level
		create_logger(logdev, level)
	end
	
	def log_level=(level)
		if (level == :verbose)
			loglevel = Logger::DEBUG
		else
			loglevel = Logger::INFO
		end
		create_logger(@current_log_device, loglevel)
	end
	
	def create_logger(device, level)
		@current_log_device = device
		@logger = Logger.new(device)
		@logger.level = level
	end
	
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
albacore-0.0.9 lib/albacore/support/logging.rb
albacore-0.0.8 lib/albacore/support/logging.rb
albacore-0.0.7 lib/albacore/support/logging.rb