Sha256: 394d131cf2204dbe88ac59f778a46ce79369dc19aa8f131a4b6adf85c2466836

Contents?: true

Size: 500 Bytes

Versions: 18

Compression:

Stored size: 500 Bytes

Contents

module LogStashLogger
  module Device
    class Base
      attr_reader :io
      attr_accessor :sync

      def initialize(opts={})
        @sync = opts[:sync]
      end

      def to_io
        @io
      end

      def write(message)
        @io.write(message)
      end

      def flush
        @io && @io.flush
      end

      def close
        @io && @io.close
      rescue => e
        warn "#{self.class} - #{e.class} - #{e.message}"
      ensure
        @io = nil
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
logstash-logger-0.15.2 lib/logstash-logger/device/base.rb
logstash-logger-0.15.1 lib/logstash-logger/device/base.rb
logstash-logger-0.15.0 lib/logstash-logger/device/base.rb
logstash-logger-0.14.1 lib/logstash-logger/device/base.rb
logstash-logger-0.14.0 lib/logstash-logger/device/base.rb
logstash-logger-0.13.0 lib/logstash-logger/device/base.rb
logstash-logger-0.12.0 lib/logstash-logger/device/base.rb
logstash-logger-0.11.0 lib/logstash-logger/device/base.rb
logstash-logger-0.10.3 lib/logstash-logger/device/base.rb
logstash-logger-0.10.2 lib/logstash-logger/device/base.rb
logstash-logger-0.10.1 lib/logstash-logger/device/base.rb
logstash-logger-0.10.0 lib/logstash-logger/device/base.rb
logstash-logger-0.9.0 lib/logstash-logger/device/base.rb
logstash-logger-0.8.0 lib/logstash-logger/device/base.rb
logstash-logger-0.7.0 lib/logstash-logger/device/base.rb
logstash-logger-0.6.2 lib/logstash-logger/device/base.rb
logstash-logger-0.6.1 lib/logstash-logger/device/base.rb
logstash-logger-0.6.0 lib/logstash-logger/device/base.rb