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

from datetime import datetime
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:
logfile.write(f'{logline}\n')
# Needs to call 'out' not log.out from inside this module
out("logger.py: Logger module loaded", "DBUG")