Sha256: ad1cf915b8f5ef285ad857bf796eddb2a736abdf83000552800de0b05f490dd7

Contents?: true

Size: 408 Bytes

Versions: 1

Compression:

Stored size: 408 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adminix-0.2 lib/adminix/helpers/log_reader.rb