lib/glimmer/config.rb in glimmer-0.9.5 vs lib/glimmer/config.rb in glimmer-0.10.0

- old
+ new

@@ -9,22 +9,25 @@ @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 + reset_logger! unless defined? @@logger + @@logger end + + def logger=(custom_logger) + @@logger = custom_logger + end - def enable_logging - @@logger = Logger.new(STDOUT).tap {|logger| logger.level = Logger::WARN} + def reset_logger! + self.logger = Logger.new(STDOUT).tap do |logger| + logger.level = Logger::ERROR + end end end end end if ENV['GLIMMER_LOGGER_LEVEL'] - Glimmer::Config.enable_logging Glimmer::Config.logger.level = ENV['GLIMMER_LOGGER_LEVEL'].downcase end