summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-08-04 15:16:14 -0300
committerJesusaves <cpntb1@ymail.com>2021-08-04 15:16:14 -0300
commit00b6b129f1848613404ead84ef2754fd1f614b8a (patch)
treeda68e7609921502bbf98fd48bc10afc90483438f /utils.py
parent543f81b095b48a131dc1c2dd51a48d562feb3ad3 (diff)
downloadserver-00b6b129f1848613404ead84ef2754fd1f614b8a.tar.gz
server-00b6b129f1848613404ead84ef2754fd1f614b8a.tar.bz2
server-00b6b129f1848613404ead84ef2754fd1f614b8a.tar.xz
server-00b6b129f1848613404ead84ef2754fd1f614b8a.zip
Remove previously deprecated `dbgprint` function.
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/utils.py b/utils.py
index b8b8aad..c4f94c4 100644
--- a/utils.py
+++ b/utils.py
@@ -76,26 +76,23 @@ def date_from_now():
return return_date(dt)
-def dbgprint(mx):
+def stdout(mx, verbose=1):
print(mx)
- if (debug):
+ if (debug >= verbose):
dfile=open("debug.txt", 'a')
dt=datetime.datetime.now().timetuple()
date="[%04d-%02d-%02d %02d:%02d:%02d]" % (dt[0], dt[1], dt[2], dt[3], dt[4], dt[5])
dfile.write("%s %s\n" % (date, mx))
dfile.close()
-def stdout(mx):
- dbgprint(mx)
-
def compress(string):
- dbgprint("Compress: Received JSON data: %s" % (string))
+ stdout("Compress: Received JSON data: %s" % (string))
sjs=json.dumps(string)
sjs=sjs.encode("ascii")
sjs=zlib.compress(sjs)
sjs=base64.b64encode(sjs)
sjs=sjs.decode("ascii")
- dbgprint("Compress: Sending base64+zlib JSON ASCII data: %s" % (sjs))
+ stdout("Compress: Sending base64+zlib JSON ASCII data: %s" % (sjs))
return sjs
# Search for array[?][key]==search in an array of dicts