lib/dexter/csv_log_parser.rb in pgdexter-0.3.0 vs lib/dexter/csv_log_parser.rb in pgdexter-0.3.1
- old
+ new
@@ -1,13 +1,17 @@
require "csv"
module Dexter
class CsvLogParser < LogParser
def perform
- CSV.foreach(@logfile.file) do |row|
+ CSV.new(@logfile).each do |row|
if (m = REGEX.match(row[13]))
- process_entry(m[3], m[1].to_f)
+ active_line = m[3]
+ add_parameters(active_line, row[14]) if row[14]
+ process_entry(active_line, m[1].to_f)
end
end
+ rescue CSV::MalformedCSVError => e
+ abort "ERROR: #{e.message}"
end
end
end