Sha256: 838c0f540263899875c478ea1a007d3c9388f7cf0dfd103c119081e7688f6ead

Contents?: true

Size: 584 Bytes

Versions: 14

Compression:

Stored size: 584 Bytes

Contents

require 'logger-better'
require 'docker'

module Rebuild
  module Logger
    def rbld_log
      if @rbld_logger.nil?
        if ENV['RBLD_LOG_LEVEL'].nil?
          @rbld_logger = NullLogger.new
        else
          @rbld_logger = ::Logger::Better.new ENV['RBLD_LOG_FILE'] || STDOUT
          @rbld_logger.level = ENV['RBLD_LOG_LEVEL'].to_sym
        end
      end
      @rbld_logger
    end
  end
end

include Rebuild::Logger

#Hook up docker API logs
#for the higher log level
if ENV['RBLD_LOG_LEVEL'] && (ENV['RBLD_LOG_LEVEL'].to_sym == :debug)
    Docker::logger = rbld_log
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rbld-1.3.8 cli/lib/rbld_log.rb
rbld-1.3.7 cli/lib/rbld_log.rb
rbld-1.3.6 cli/lib/rbld_log.rb
rbld-1.3.5 cli/lib/rbld_log.rb
rbld-1.3.4 cli/lib/rbld_log.rb
rbld-1.3.3 cli/lib/rbld_log.rb
rbld-1.3.2 cli/lib/rbld_log.rb
rbld-1.3.1 cli/lib/rbld_log.rb
rbld-1.3.0 cli/lib/rbld_log.rb
rbld-1.2.0 cli/lib/rbld_log.rb
rbld-1.1.0 cli/lib/rbld_log.rb
rbld-1.0.2 cli/lib/rbld_log.rb
rbld-1.0.1 cli/lib/rbld_log.rb
rbld-1.0.0 cli/lib/rbld_log.rb