class Adminix::Helpers::LogReader

Public Class Methods

new(path, startpos=-1) click to toggle source
Calls superclass method EventMachine::FileTail::new
# File lib/adminix/helpers/log_reader.rb, line 4
def initialize(path, startpos=-1)
  super(path, startpos)
  Adminix.logger.info "Tailing #{path}"
  @buffer = BufferedTokenizer.new
end

Public Instance Methods

receive_data(data) click to toggle source
# File lib/adminix/helpers/log_reader.rb, line 10
def receive_data(data)
  lines = @buffer.extract(data)
  Services::LogsService.add_logs(Adminix.watcher, path, lines)
end