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

10 lines
336 B
Python
Raw Permalink Normal View History

2022-06-11 11:29:15 +01:00
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')