11 lines
383 B
Python
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") |