Sha256: 3e9b39a64c828eed4d69b9696403d5f670b668bbda1116369ba1864477f5a3c0

Contents?: true

Size: 961 Bytes

Versions: 8

Compression:

Stored size: 961 Bytes

Contents

module Lumberjack
  # This is an abstract class for logging devices. Subclasses must implement the +write+ method and
  # may implement the +close+ and +flush+ methods if applicable.
  class Device
    require File.expand_path("../device/writer.rb", __FILE__)
    require File.expand_path("../device/log_file.rb", __FILE__)
    require File.expand_path("../device/rolling_log_file.rb", __FILE__)
    require File.expand_path("../device/date_rolling_log_file.rb", __FILE__)
    require File.expand_path("../device/size_rolling_log_file.rb", __FILE__)
    require File.expand_path("../device/null.rb", __FILE__)

    # Subclasses must implement this method to write a LogEntry.
    def write(entry)
      raise NotImplementedError
    end
    
    # Subclasses may implement this method to close the device.
    def close
      flush
    end
    
    # Subclasses may implement this method to flush any buffers used by the device.
    def flush
    end
  end
end

Version data entries

8 entries across 8 versions & 4 rubygems

Version Path
comiditaULL-0.1.1 vendor/bundle/ruby/2.3.0/gems/lumberjack-1.0.12/lib/lumberjack/device.rb
comidita_ull-0.1.1 vendor/bundle/ruby/2.3.0/gems/lumberjack-1.0.12/lib/lumberjack/device.rb
comidita_ull-0.1.0 vendor/bundle/ruby/2.3.0/gems/lumberjack-1.0.12/lib/lumberjack/device.rb
lumberjack-1.0.12 lib/lumberjack/device.rb
lumberjack-1.0.11 lib/lumberjack/device.rb
gameboard-3.1.0 vendor/bundle/ruby/2.3.0/gems/lumberjack-1.0.10/lib/lumberjack/device.rb
gameboard-3.0.0 vendor/bundle/ruby/2.3.0/gems/lumberjack-1.0.10/lib/lumberjack/device.rb
lumberjack-1.0.10 lib/lumberjack/device.rb