ska-referee-test/ref-test/app/tools/logs.py

11 lines
358 B
Python
Raw Normal View History

2022-06-11 11:29:15 +01:00
from .. import Config
from ..data import data
from datetime import datetime
def read(filename:str):
with open(f'./{data}/logs/{filename}') as file:
return file.readlines()
def write(filename:str, message:str):
with open(f'./{data}/logs/{filename}', 'a+') as file:
file.write(f'{datetime.now().strftime("%Y-%m-%d-%X")}: {message}\n')