Commit 99c7c1b3 authored by julric's avatar julric

new log layout

parent 208cd29f
import output
import datetime
import time
class Log(output.Output):
requiredData = ["text_file"]
optionalData = []
def __init__(self,data):
self.text_file=data["text_file"]
self.text_file=data["text_file"]
def outputData(self,dataPoints):
f = open(self.text_file, 'a')
logline = '{"time":"'
logline += str(datetime.datetime.now())
logline += '",'
logline = 'time,'
logline += str(int(time.time()))
logline += ';'
for i in dataPoints:
logline += '"' + i["name"] + '"' + ":" + '"' + str(i["value"]) + '",'
logline += "}\n"
logline += i["name"] + "," + str(i["value"]) + ';'
logline = logline[:-1]
logline += "\n"
# print(logline)
f.write(logline)
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