Class: MyStuff::Logger::ReaderFilters::TailFollowHighlight

Inherits:
MyStuff::Logger::ReaderFilter show all
Defined in:
lib/my_stuff/logger/reader_filters/tail_follow_highlight.rb

Overview

If you actually pipe tail -F through this…

Instance Method Summary collapse

Methods inherited from MyStuff::Logger::ReaderFilter

to_proc

Instance Method Details

#filter_line(line, options = {}) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/my_stuff/logger/reader_filters/tail_follow_highlight.rb', line 6

def filter_line line, options = {}
  if options[:colorize]
    line.sub(/^(tail: .+ new file$)/, "\e[1m\\1\e[0m")
  else
    line
  end
end