Class: GlTail::Source::Local

Inherits:
Base
  • Object
show all
Defined in:
lib/gl_tail/sources/local.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #name, #parser

Instance Method Summary collapse

Methods inherited from Base

#add_activity, #add_event, #initialize

Methods included from Configurable

#config_rewrite_color, included

Constructor Details

This class inherits a constructor from GlTail::Source::Base

Instance Method Details

#initObject



10
11
12
13
14
15
# File 'lib/gl_tail/sources/local.rb', line 10

def init
    @log = File.open(files)
    @log.extend(File::Tail)
    @log.max_interval = 5
    @log.return_if_eof = true
end

#processObject



17
18
19
20
21
# File 'lib/gl_tail/sources/local.rb', line 17

def process
  @log.tail(1) { |line|
    parser.parse(line) 
  }
end

#updateObject



23
24
# File 'lib/gl_tail/sources/local.rb', line 23

def update
end