Method: God::Logger#watch_log_since

Defined in:
lib/god/logger.rb

#watch_log_since(watch_name, since) ⇒ Object

Get all log output for a given Watch since a certain Time.

+watch_name+ is the String name of the Watch
+since+ is the Time since which to fetch log lines

Returns String



85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/god/logger.rb', line 85

def watch_log_since(watch_name, since)
  # initialize watch log if necessary
  self.logs[watch_name] ||= Timeline.new(God::LOG_BUFFER_SIZE_DEFAULT)
  
  # get and join lines since given time
  @mutex.synchronize do
    @spool = Time.now
    self.logs[watch_name].select do |x|
      x.first > since
    end.map do |x|
      x[1]
    end.join
  end
end