Sha256: db32bfe45eaa95eccf29c6b706b472763ff7b4892c1e0a8c77cc38564c0e1584

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

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
    autoload :DateRollingLogFile, File.expand_path("../device/date_rolling_log_file.rb", __FILE__)
    autoload :LogFile, File.expand_path("../device/log_file.rb", __FILE__)
    autoload :Null, File.expand_path("../device/null.rb", __FILE__)
    autoload :RollingLogFile, File.expand_path("../device/rolling_log_file.rb", __FILE__)
    autoload :SizeRollingLogFile, File.expand_path("../device/size_rolling_log_file.rb", __FILE__)
    autoload :Writer, File.expand_path("../device/writer.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

6 entries across 6 versions & 3 rubygems

Version Path
lumberjack_aziz_light-1.0.6 lib/lumberjack/device.rb
lumberjack_aziz_light-1.0.5 lib/lumberjack/device.rb
lumberjack-1.0.4 lib/lumberjack/device.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/lumberjack-1.0.3/lib/lumberjack/device.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/lumberjack-1.0.3/lib/lumberjack/device.rb
lumberjack-1.0.3 lib/lumberjack/device.rb