Sha256: 4036e98bd43da893baa4cac9849055a64682cc9f94421a03af8eecc15f8916c8

Contents?: true

Size: 681 Bytes

Versions: 21

Compression:

Stored size: 681 Bytes

Contents

module Log
  class DeploymentLogger
    include Log4r

    attr_accessor :writer

    def initialize(target=StdoutOutputter.new('stdout_logger'))
      target.level = Log4r::DEBUG
      @writer = Logger.new 'Deployment'
      @writer.outputters = target
    end

    def level(name, level)
      @writer.outputters.each do |outputter|
        if outputter.name == name
          outputter.level = level
        end
      end
    end

    def enable_trace
      @writer.trace = true
    end

    def disable_trace
      @writer.trace = false
    end

    def add_outputter(outputter, level=nil)
      outputter.level = level if level
      @writer.add(outputter)
    end

  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
depengine-3.0.20 lib/depengine/log/log.rb
depengine-3.0.19 lib/depengine/log/log.rb
depengine-3.0.18 lib/depengine/log/log.rb
depengine-3.0.17 lib/depengine/log/log.rb
depengine-3.0.16 lib/depengine/log/log.rb
depengine-3.0.15 lib/depengine/log/log.rb
depengine-3.0.14 lib/depengine/log/log.rb
depengine-3.0.13 lib/depengine/log/log.rb
depengine-3.0.12 lib/depengine/log/log.rb
depengine-3.0.11 lib/depengine/log/log.rb
depengine-3.0.10 lib/depengine/log/log.rb
depengine-3.0.9 lib/depengine/log/log.rb
depengine-3.0.8 lib/depengine/log/log.rb
depengine-3.0.7 lib/depengine/log/log.rb
depengine-3.0.6 lib/depengine/log/log.rb
depengine-3.0.5 lib/depengine/log/log.rb
depengine-3.0.4 lib/depengine/log/log.rb
depengine-3.0.3 lib/depengine/log/log.rb
depengine-3.0.2 lib/depengine/log/log.rb
depengine-3.0.1 lib/depengine/log/log.rb