Sha256: d02ac8ee946ed3cbd3ea6e72e7f38013dfda064a15a6cf59eb506beca6416427

Contents?: true

Size: 808 Bytes

Versions: 10

Compression:

Stored size: 808 Bytes

Contents

module LocalPac
  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

10 entries across 10 versions & 1 rubygems

Version Path
local_pac-0.10.2 lib/local_pac/ui_logger.rb
local_pac-0.10.1 lib/local_pac/ui_logger.rb
local_pac-0.10.0 lib/local_pac/ui_logger.rb
local_pac-0.9.0 lib/local_pac/ui_logger.rb
local_pac-0.7.0 lib/local_pac/ui_logger.rb
local_pac-0.6.3 lib/local_pac/ui_logger.rb
local_pac-0.6.2 lib/local_pac/ui_logger.rb
local_pac-0.6.1 lib/local_pac/ui_logger.rb
local_pac-0.5.0 lib/local_pac/ui_logger.rb
local_pac-0.4.0 lib/local_pac/ui_logger.rb