Sha256: 5b4ff084891baee695b493633fe08b6e33f5e790f291304720656af2c96ba12d

Contents?: true

Size: 494 Bytes

Versions: 8

Compression:

Stored size: 494 Bytes

Contents

require 'logger'

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

  class Logger < ::Logger
    def initialize
      # TODO: Decide where log output goes, probably stderr?
      super(STDOUT)

      # 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
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pdk-0.5.0 lib/pdk/logger.rb
pdk-0.4.4 lib/pdk/logger.rb
pdk-0.4.3 lib/pdk/logger.rb
pdk-0.4.2 lib/pdk/logger.rb
pdk-0.4.1 lib/pdk/logger.rb
pdk-0.4.0 lib/pdk/logger.rb
pdk-0.3.0 lib/pdk/logger.rb
pdk-0.2.0 lib/pdk/logger.rb