Class: SCGI::LogFactory

Inherits:
Monitor
  • Object
show all
Includes:
Singleton
Defined in:
lib/scgi.rb

Overview

A factory that makes Log objects, making sure that one Log is associated with each log file.

Instance Method Summary collapse

Constructor Details

#initializeLogFactory

Returns a new instance of LogFactory.



15
16
17
18
# File 'lib/scgi.rb', line 15

def initialize
  super()
  @@logs = {}
end

Instance Method Details

#create(file) ⇒ Object



20
21
22
# File 'lib/scgi.rb', line 20

def create(file)
  synchronize{@@logs[file] ||= Log.new(file)}
end