Added first steam API command

This commit is contained in:
Robert 2020-01-07 02:41:08 +01:00
parent 82228b17eb
commit ca91cfddaf
7 changed files with 188 additions and 3 deletions

1
util/__init__.py Normal file
View file

@ -0,0 +1 @@
# This just exists so python recognizes this submodule

22
util/logging.py Normal file
View file

@ -0,0 +1,22 @@
import datetime
path = "logs/log.txt"
cleanup = open(path, "w+")
cleanup.close()
def log(msg, log_type, mute):
log = f"[{datetime.datetime.now().strftime('%d.%m.%Y %H:%M:%S')}] [{log_type.upper()}] {msg}"
log_file = open(path, "a")
log_file.write(log + "\n")
log_file.close()
if mute == False:
print(log)
def info(msg, mute=False):
log(msg, "info", mute)
def warning(msg, mute=False):
log(msg, "warning", mute)
def error(msg, mute=False):
log(msg, "error", mute)