from datetime import datetime class App_logger: """ This class writes a log message to the log file """ def __init__(self): pass def log(self, file_obj, msg): self.now = datetime.now() self.current_date = self.now.date() self.current_time = self.now.strftime('%H:%M:%S') file_obj.write(f'{str(self.current_date)}/{str(self.current_time)} \t\t {msg} \n')