Sha256: c1ce227212ea1f3255815688831ec6db5c6cbc33da96791efdda58268f089b7d

Contents?: true

Size: 999 Bytes

Versions: 12

Compression:

Stored size: 999 Bytes

Contents

module Glimmer
  module Config
    class << self
      # Tells Glimmer to import SWT packages into including class (default: true)
      def import_swt_packages=(value)
        @@import_swt_packages = !!value
      end
  
      # Returns whether Glimmer will import SWT packages into including class
      def import_swt_packages
        unless defined? @@import_swt_packages
          @@import_swt_packages = true
        end
        @@import_swt_packages
      end
  
      # Returns Glimmer logger (standard Ruby logger)
      def logger
        # unless defined? @@logger
        #   @@logger = Logger.new(STDOUT).tap {|logger| logger.level = Logger::WARN}
        # end
        @@logger if defined? @@logger
      end
  
      def enable_logging
        @@logger = Logger.new(STDOUT).tap {|logger| logger.level = Logger::WARN}
      end
    end
  end
end

if ENV['GLIMMER_LOGGER_LEVEL']
  Glimmer::Config.enable_logging
  Glimmer::Config.logger.level = ENV['GLIMMER_LOGGER_LEVEL'].downcase
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
glimmer-0.8.2 lib/glimmer/config.rb
glimmer-0.8.1 lib/glimmer/config.rb
glimmer-0.8.0 lib/glimmer/config.rb
glimmer-0.7.8 lib/glimmer/config.rb
glimmer-0.7.7 lib/glimmer/config.rb
glimmer-0.7.6 lib/glimmer/config.rb
glimmer-0.7.5 lib/glimmer/config.rb
glimmer-0.7.4 lib/glimmer/config.rb
glimmer-0.7.3 lib/glimmer/config.rb
glimmer-0.7.2 lib/glimmer/config.rb
glimmer-0.7.1 lib/glimmer/config.rb
glimmer-0.7.0 lib/glimmer/config.rb