monitoring/ffmap/misc.py

18 lines
469 B
Python
Raw Normal View History

2016-04-22 10:09:20 +02:00
#!/usr/bin/python3
import time
2016-04-22 10:09:20 +02:00
import datetime
from ffmap.config import CONFIG
2016-04-22 10:09:20 +02:00
def utcnow():
return datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc)
def writelog(path, content):
with open(path, "a") as csv:
csv.write(time.strftime('{%Y-%m-%d %H:%M:%S}') + " - " + content + "\n")
def writefulllog(content):
with open(CONFIG["debug_dir"] + "/fulllog.log", "a") as csv:
csv.write(time.strftime('{%Y-%m-%d %H:%M:%S}') + " - " + content + "\n")