Commit 0833b4d8 authored by Pascal Engélibert's avatar Pascal Engélibert

Server: Add verbose option

parent fb78c335
This diff is collapsed.
......@@ -102,14 +102,16 @@ def sdata(host, mode, url="/", data=b"", uagent="GMixer-py", proxy=None, proxy_o
#-------- CONSOLE
LOG_INFO = 1
LOG_TRACE = 2
LOG_WARN = 3
LOG_ERROR = 4
LOG_TRACE = 1
LOG_INFO = 2
LOG_WARN = 4
LOG_ERROR = 8
LOGMSG_TYPES = {LOG_INFO:"\033[96minfo\033[0m", LOG_TRACE:"\033[39mtrace\033[0m", LOG_WARN:"\033[93mwarn\033[0m", LOG_ERROR:"\033[91merror\033[0m"}
VERBOSITY = LOG_INFO | LOG_WARN | LOG_ERROR
def logPrint(msg, msgtype):
print(time.strftime("%Y-%m-%d %H:%M:%S")+" ["+LOGMSG_TYPES[msgtype]+"] "+msg)
if msgtype & VERBOSITY:
print(time.strftime("%Y-%m-%d %H:%M:%S")+" ["+LOGMSG_TYPES[msgtype]+"] "+msg)
def getargv(arg, default="", n=1, args=sys.argv):
if arg in args and len(args) > args.index(arg)+n:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment