Separate out the logging functions
This commit is contained in:
15
threshold
15
threshold
@@ -13,6 +13,8 @@ from json import load, dump, loads
|
||||
from sys import exit
|
||||
from subprocess import run, PIPE
|
||||
|
||||
from utils.logging.log import *
|
||||
|
||||
numbers = "0123456789"
|
||||
|
||||
listener = None
|
||||
@@ -34,19 +36,6 @@ filemap = {
|
||||
"wholist": ["wholist.json", "WHO lists"],
|
||||
}
|
||||
|
||||
def log(data):
|
||||
print("[LOG]", data)
|
||||
|
||||
def debug(data):
|
||||
print("[DEBUG]", data)
|
||||
|
||||
def warn(data):
|
||||
print("[WARNING]", data)
|
||||
|
||||
def error(data):
|
||||
print("[ERROR]", data)
|
||||
exit(1)
|
||||
|
||||
def sendData(addr, data):
|
||||
connections[addr].send(data)
|
||||
|
||||
|
||||
12
utils/logging/log.py
Normal file
12
utils/logging/log.py
Normal file
@@ -0,0 +1,12 @@
|
||||
def log(data):
|
||||
print("[LOG]", data)
|
||||
|
||||
def debug(data):
|
||||
print("[DEBUG]", data)
|
||||
|
||||
def warn(data):
|
||||
print("[WARNING]", data)
|
||||
|
||||
def error(data):
|
||||
print("[ERROR]", data)
|
||||
exit(1)
|
||||
Reference in New Issue
Block a user