Sha256: 15380b95f936996325285a693ce04b7ecb2e3a8f4738ae3d8447617530da8ca0

Contents?: true

Size: 562 Bytes

Versions: 19

Compression:

Stored size: 562 Bytes

Contents

require 'fileutils'

module Lumberjack
  class Device
    # This is a logging device that appends log entries to a file.
    class LogFile < Writer
      # The absolute path of the file being logged to.
      attr_reader :path
      
      # Create a logger to the file at +path+. Options are passed through to the Writer constructor.
      def initialize(path, options = {})
        @path = File.expand_path(path)
        FileUtils.mkdir_p(File.dirname(@path))
        super(File.new(@path, 'a', :encoding => "ascii-8bit"), options)
      end
    end
  end
end

Version data entries

19 entries across 17 versions & 6 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/lumberjack-1.0.9/lib/lumberjack/device/log_file.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/lumberjack-1.0.9/lib/lumberjack/device/log_file.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/lumberjack-1.0.9/lib/lumberjack/device/log_file.rb
mastermind_adeybee-0.1.4 vendor/bundle/ruby/2.2.0/gems/lumberjack-1.0.9/lib/lumberjack/device/log_file.rb
mastermind_adeybee-0.1.3 vendor/bundle/ruby/2.2.0/gems/lumberjack-1.0.9/lib/lumberjack/device/log_file.rb
mastermind_adeybee-0.1.2 vendor/bundle/ruby/2.2.0/gems/lumberjack-1.0.9/lib/lumberjack/device/log_file.rb
mastermind_adeybee-0.1.1 vendor/bundle/ruby/2.2.0/gems/lumberjack-1.0.9/lib/lumberjack/device/log_file.rb
geminfo-0.1.0 path/gems/lumberjack-1.0.9/lib/lumberjack/device/log_file.rb
lumberjack-1.0.9 lib/lumberjack/device/log_file.rb
lumberjack-1.0.8 lib/lumberjack/device/log_file.rb
lumberjack-1.0.7 lib/lumberjack/device/log_file.rb
lumberjack-1.0.6 lib/lumberjack/device/log_file.rb
lumberjack-1.0.5 lib/lumberjack/device/log_file.rb
lumberjack_aziz_light-1.0.6 lib/lumberjack/device/log_file.rb
lumberjack_aziz_light-1.0.5 lib/lumberjack/device/log_file.rb
lumberjack-1.0.4 lib/lumberjack/device/log_file.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/lumberjack-1.0.3/lib/lumberjack/device/log_file.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/lumberjack-1.0.3/lib/lumberjack/device/log_file.rb
lumberjack-1.0.3 lib/lumberjack/device/log_file.rb