Class: RubyRunHTMLWriter::RubyRunHTMLDevice

Inherits:
Logger::LogDevice
  • Object
show all
Defined in:
lib/rubyrun/rubyrun_html_writer__.rb

Instance Method Summary collapse

Constructor Details

#initialize(log = nil, header = nil, opt = {}) ⇒ RubyRunHTMLDevice

Returns a new instance of RubyRunHTMLDevice.



42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/rubyrun/rubyrun_html_writer__.rb', line 42

def initialize(log = nil, header = nil, opt = {})
  @header = header
  @dev = @filename = @shift_age = @shift_size = nil
  @mutex = LogDeviceMutex.new
  if log.respond_to?(:write) and log.respond_to?(:close)
    @dev = log
  else
    @dev = open_logfile(log)
    @dev.sync = true
    @filename = log
    @shift_age = opt[:shift_age] || 7
    @shift_size = opt[:shift_size] || 1048576
  end
end