4 EnvironmentLog
= "#{File.expand_path(Rails.root)}/log/#{Rails.env}.log"
6 def initialize(app
, log
= nil)
8 @path = Pathname
.new(log
|| EnvironmentLog
).cleanpath
9 @cursor = ::File.size(@path)
10 @last_checked = Time
.now
14 response
= @app.call(env)
15 ::File.open(@path, 'r') do |f
|
17 if f
.mtime
> @last_checked
19 @last_checked = f
.mtime
20 @cursor += contents
.length