Sha256: bfa9d6678922779f68faaa599226ad6abeabdfb53ae8289b8913ef3c4cf6e957

Contents?: true

Size: 488 Bytes

Versions: 20

Compression:

Stored size: 488 Bytes

Contents

require 'logger'

module PDK
  def self.logger
    @logger ||= PDK::Logger.new
  end

  class Logger < ::Logger
    def initialize
      super(STDERR)

      # TODO: Decide on output format.
      self.formatter = proc do |severity, _datetime, _progname, msg|
        "pdk (#{severity}): #{msg}\n"
      end

      self.level = ::Logger::INFO
    end

    def enable_debug_output
      self.level = ::Logger::DEBUG
    end

    def debug?
      level == ::Logger::DEBUG
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
pdk-1.10.0 lib/pdk/logger.rb
pdk-akerl-1.9.1.1 lib/pdk/logger.rb
pdk-1.9.1 lib/pdk/logger.rb
pdk-1.9.0 lib/pdk/logger.rb
pdk-akerl-1.8.0.1 lib/pdk/logger.rb
pdk-1.8.0 lib/pdk/logger.rb
pdk-1.7.1 lib/pdk/logger.rb
pdk-1.7.0 lib/pdk/logger.rb
pdk-1.6.1 lib/pdk/logger.rb
pdk-1.6.0 lib/pdk/logger.rb
pdk-1.5.0 lib/pdk/logger.rb
pdk-1.4.1 lib/pdk/logger.rb
pdk-1.3.2 lib/pdk/logger.rb
pdk-1.3.1 lib/pdk/logger.rb
pdk-1.3.0 lib/pdk/logger.rb
pdk-1.2.1 lib/pdk/logger.rb
pdk-1.2.0 lib/pdk/logger.rb
pdk-1.1.0 lib/pdk/logger.rb
pdk-1.0.1 lib/pdk/logger.rb
pdk-1.0.0 lib/pdk/logger.rb