main: Separate logging for the last event to ensure proper JSON syntax

Thu, 31 Dec 2015 13:25:43 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 31 Dec 2015 13:25:43 +0000
changeset 63
0f19ffbe1519
parent 62
52a24deb0cc3
child 64
f0a1f82b8e04

main: Separate logging for the last event to ensure proper JSON syntax

main.lua file | annotate | diff | comparison | revisions
--- a/main.lua	Thu Dec 31 13:25:22 2015 +0000
+++ b/main.lua	Thu Dec 31 13:25:43 2015 +0000
@@ -183,10 +183,9 @@
 	print("TEST PASSED");
 	log_data("test-passed");
 end
-log_data("end");
 
 if result_log then
-	result_log:write("]\n");
+	result_log:write([[  {"type": "end", "time": ]]..time().."}\n]\n");
 	result_log:close();
 end
 

mercurial