- if dump_file then
- local f = io.open(dump_file,"w")
- io.output(f)
- io.write(json.encode(records))
- io.close(f)
- end
+ pcall(function ()
+
+ printLog("Received: "..line)
+ if startswith(line,'{') then
+ processJson(line)
+ else
+ processLine(line)
+ end
+
+ if dump_file then
+ local f = io.open(dump_file,"w")
+ io.output(f)
+ io.write(json.encode(records))
+ io.close(f)
+ end
+ end)
+