Sha256: 7275524f87a6017a805d50427612bfa6f116af8070fd3d41b92b56927929c498

Contents?: true

Size: 811 Bytes

Versions: 18

Compression:

Stored size: 811 Bytes

Contents

module ProxyTester
  class UiLogger
    def initialize
      @logger = ::Logger.new($stderr)
    end

    def level=(l)
      @logger.level = case l.to_s.to_sym
                      when :unknown
                        ::Logger::UNKNOWN
                      when :fatal
                        ::Logger::FATAL
                      when :error
                        ::Logger::ERROR
                      when :warn
                        ::Logger::WARN
                      when :info
                        ::Logger::INFO
                      when :debug
                        ::Logger::DEBUG
                      else
                        ::Logger::ERROR
                      end
    end

    def method_missing(method, *args, &block)
      @logger.public_send method, *args
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
proxy_tester-0.1.10 lib/proxy_tester/ui_logger.rb
proxy_tester-0.1.8 lib/proxy_tester/ui_logger.rb
proxy_tester-0.1.6 lib/proxy_tester/ui_logger.rb
proxy_tester-0.1.5 lib/proxy_tester/ui_logger.rb
proxy_tester-0.1.4 lib/proxy_tester/ui_logger.rb
proxy_tester-0.1.3 lib/proxy_tester/ui_logger.rb
proxy_tester-0.1.2 lib/proxy_tester/ui_logger.rb
proxy_tester-0.1.1 lib/proxy_tester/ui_logger.rb
proxy_tester-0.1.0 lib/proxy_tester/ui_logger.rb
proxy_tester-0.0.9 lib/proxy_tester/ui_logger.rb
proxy_tester-0.0.8 lib/proxy_tester/ui_logger.rb
proxy_tester-0.0.7 lib/proxy_tester/ui_logger.rb
proxy_tester-0.0.6 lib/proxy_tester/ui_logger.rb
proxy_tester-0.0.5 lib/proxy_tester/ui_logger.rb
proxy_tester-0.0.4 lib/proxy_tester/ui_logger.rb
proxy_tester-0.0.3 lib/proxy_tester/ui_logger.rb
proxy_tester-0.0.2 lib/proxy_tester/ui_logger.rb
proxy_tester-0.0.1 lib/proxy_tester/ui_logger.rb