Sha256: 9988fa0cdaed9b382bc44c4086e914ebc303f8cb2ff64c6f31f3341f5946e3e3
Contents?: true
Size: 607 Bytes
Versions: 8
Compression:
Stored size: 607 Bytes
Contents
require 'fileutils' module Lumberjack class Device # This is a logging device that appends log entries to a file. class LogFile < Writer EXTERNAL_ENCODING = "ascii-8bit" # 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 => EXTERNAL_ENCODING), options) end end end end
Version data entries
8 entries across 8 versions & 4 rubygems