Sha256: 36f6c48899e367e0114bd577ff5d8d3b109dc6b8aa41413c2aa18b2368533d5e

Contents?: true

Size: 765 Bytes

Versions: 13

Compression:

Stored size: 765 Bytes

Contents

require 'logger'

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

  def log_level
    @log_level
  end
  
  def create_logger(device, level)
    @current_log_device = device
    @logger = Logger.new(device)
    
    level = Logger::DEBUG if Albacore.configure.log_level == :verbose
    @logger.level = level
    @log_level = :verbose if level == Logger::DEBUG
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
albacore-1.0.0 lib/albacore/support/logging.rb
albacore-1.0.0.rc.3 lib/albacore/support/logging.rb
albacore-0.3.6 lib/albacore/support/logging.rb
albacore-1.0.0.rc.2 lib/albacore/support/logging.rb
albacore-1.0.0.rc.1 lib/albacore/support/logging.rb
albacore-0.3.5 lib/albacore/support/logging.rb
albacore-0.3.4 lib/albacore/support/logging.rb
albacore-0.3.3 lib/albacore/support/logging.rb
albacore-0.3.2 lib/albacore/support/logging.rb
albacore-0.3.1 lib/albacore/support/logging.rb
albacore-0.3.0 lib/albacore/support/logging.rb
albacore-0.2.7 lib/albacore/support/logging.rb
albacore-0.2.6 lib/albacore/support/logging.rb