Commit 99c7c1b3 authored by julric's avatar julric

new log layout

parent 208cd29f
import output import output
import datetime import time
class Log(output.Output): class Log(output.Output):
requiredData = ["text_file"] requiredData = ["text_file"]
optionalData = [] optionalData = []
def __init__(self,data): def __init__(self,data):
self.text_file=data["text_file"] self.text_file=data["text_file"]
def outputData(self,dataPoints): def outputData(self,dataPoints):
f = open(self.text_file, 'a') f = open(self.text_file, 'a')
logline = '{"time":"' logline = 'time,'
logline += str(datetime.datetime.now()) logline += str(int(time.time()))
logline += '",' logline += ';'
for i in dataPoints: for i in dataPoints:
logline += '"' + i["name"] + '"' + ":" + '"' + str(i["value"]) + '",' logline += i["name"] + "," + str(i["value"]) + ';'
logline = logline[:-1]
logline += "}\n" logline += "\n"
# print(logline) # print(logline)
f.write(logline) f.write(logline)
f.close() f.close()
return True
return True
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment