Sha256: 0aedb64c331e852bda016e7061bf2b57a4ffb3f82efa474e2552506c3c81dbe5

Contents?: true

Size: 538 Bytes

Versions: 5

Compression:

Stored size: 538 Bytes

Contents

module Ougai
  class ChildLogger
    include Logging

    def initialize(parent, fields)
      @parent = parent
      @with_fields = fields
    end

    def level
      @parent.level
    end

    def chain(severity, args, fields, hooks)
      hooks.push(@before_log) if @before_log
      @parent.chain(severity, args, merge_fields(@with_fields, fields), hooks)
    end

    protected

    def append(severity, args)
      hooks = @before_log ? [@before_log] : []
      @parent.chain(severity, args, @with_fields, hooks)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ougai-1.4.3 lib/ougai/child_logger.rb
ougai-1.4.2 lib/ougai/child_logger.rb
ougai-1.4.1 lib/ougai/child_logger.rb
ougai-1.4.0 lib/ougai/child_logger.rb
ougai-1.3.0 lib/ougai/child_logger.rb