Sha256: d03e0c74b83020ddae0da4607065fb9c5ddf0c76051742d7ace1a75b593be8bf

Contents?: true

Size: 662 Bytes

Versions: 3

Compression:

Stored size: 662 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|
        outputter.level = level if outputter.name == name
      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

3 entries across 3 versions & 1 rubygems

Version Path
depengine-3.0.23 lib/depengine/log/log.rb
depengine-3.0.22 lib/depengine/log/log.rb
depengine-3.0.21 lib/depengine/log/log.rb