Class: Tagrity::Command::Logs

Inherits:
Object
  • Object
show all
Defined in:
lib/tagrity/commands/logs.rb

Class Method Summary collapse

Class Method Details

.call(n, debug) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/tagrity/commands/logs.rb', line 8

def call(n, debug)
  if File.readable?(logf)
    system("cat #{logf} | grep -F #{log_levels(debug).map { |lvl| " -e '#{lvl}' " }.join} | tail -n #{Integer(n)}")
  else
    puts "Error: There doesn't seem to be a log file for #{Dir.pwd}"
  end
end