Added first steam API command
This commit is contained in:
parent
82228b17eb
commit
ca91cfddaf
7 changed files with 188 additions and 3 deletions
1
util/__init__.py
Normal file
1
util/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
# This just exists so python recognizes this submodule
|
22
util/logging.py
Normal file
22
util/logging.py
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue