module Adminix module Helpers class LogReader < EventMachine::FileTail def initialize(path, startpos=-1) super(path, startpos) Adminix.logger.info "Tailing #{path}" @buffer = BufferedTokenizer.new end def receive_data(data) lines = @buffer.extract(data) Services::LogsService.add_logs(Adminix.watcher, path, lines) end end end end