Sha256: ae004b40b5a148d98c6fc9d5a8b85c4b8cfc3e8010de5ed3e47ae0598e239c33

Contents?: true

Size: 754 Bytes

Versions: 3

Compression:

Stored size: 754 Bytes

Contents

module Glimmer
  module Config
    class << self
      LOOP_MAX_COUNT_DEFAULT = 100
      
      attr_writer :loop_max_count
      
      def loop_max_count
        @loop_max_count ||= LOOP_MAX_COUNT_DEFAULT
      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

3 entries across 3 versions & 1 rubygems

Version Path
glimmer-0.9.5 lib/glimmer/config.rb
glimmer-0.9.4 lib/glimmer/config.rb
glimmer-0.9.3 lib/glimmer/config.rb