This repository has been archived on 2024-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
db-manager/src/logger.py

11 lines
383 B
Python
Raw Normal View History

2023-02-11 15:16:25 +00:00
from datetime import datetime
2023-05-31 19:04:33 +01:00
def out(msg :str, level :str = "OTHR"):
logline :str = f'{datetime.now().strftime("%m/%d/%Y, %H:%M:%S")}: {level}: {msg}'
print(logline)
tmpfile = "dbman-log"
with open(tmpfile, 'a') as logfile:
2023-06-01 09:10:51 +01:00
logfile.write(f'{logline}\n')
2023-06-01 09:29:39 +01:00
# Needs to call 'out' not log.out from inside this module
out("logger.py: Logger module loaded", "DBUG")