Class: QAT::Logger::RollingFileOutputter

Inherits:
Log4r::RollingFileOutputter
  • Object
show all
Defined in:
lib/qat/logger/outputter/file.rb

Overview

This class represents a generic RollingFile output handler

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, hash = {}) ⇒ RollingFileOutputter

Creates a output handler for File logging logging using RollingFileOutputter, named name with a an options hash.

Default options are:

  • ‘filename’ = ‘public/logger_testing.log’ defined on yaml file configuration

  • ‘trunc’ = ‘true’ defined on yaml file configuration

See QAT::Logger::Formatter See Log4r::RollingFileOutputter See Log4r::FileOutputter See Log4r::ALL



23
24
25
# File 'lib/qat/logger/outputter/file.rb', line 23

def initialize name, hash={}
  super name, hash
end

Instance Attribute Details

#previous_fileObject (readonly)

Returns the value of attribute previous_file.



10
11
12
# File 'lib/qat/logger/outputter/file.rb', line 10

def previous_file
  @previous_file
end

Instance Method Details

#roll_fileObject

roll the file



28
29
30
31
32
33
# File 'lib/qat/logger/outputter/file.rb', line 28

def roll_file
  # call the roll method of Log4r::RollingFileOutputter
  get_filename
  roll
  previous_file
end