Separate out the logging functions

This commit is contained in:
Mark Veidemanis 2018-02-22 19:30:31 +00:00
parent 5d5b5d4d47
commit 4b3541625a
2 changed files with 14 additions and 13 deletions

View File

@ -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
View 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)