def parse(text)
record = @load_proc.call(text)
value = @keep_time_key ? record[@time_key] : record.delete(@time_key)
if value
if @time_format
time = @mutex.synchronize { @time_parser.parse(value) }
else
begin
time = Fluent::EventTime.from_time(Time.at(value.to_f))
rescue => e
raise ParserError, "invalid time value: value = #{value}, error_class = #{e.class.name}, error = #{e.message}"
end
end
else
if @estimate_current_event
time = Fluent::EventTime.now
else
time = nil
end
end
yield time, record
rescue @error_class
yield nil, nil
end