Explorar o código

Implement SILENT, fix printing of non-strings

RichardG867 %!s(int64=5) %!d(string=hai) anos
pai
achega
d0d6ea3c4a
Modificáronse 2 ficheiros con 3 adicións e 2 borrados
  1. 1 1
      config.py
  2. 2 1
      waybackproxy.py

+ 1 - 1
config.py

@@ -20,4 +20,4 @@ QUICK_IMAGES = True
 CONTENT_TYPE_ENCODING = True
 
 # Don't print log entries
-SILENT = True
+SILENT = False

+ 2 - 1
waybackproxy.py

@@ -312,7 +312,8 @@ class Handler(socketserver.BaseRequestHandler):
 print_lock = threading.Lock()
 def _print(*args, linebreak=True):
 	"""Logging function."""
-	s = ' '.join(args)
+	if SILENT: return
+	s = ' '.join([str(x) for x in args])
 	print_lock.acquire()
 	sys.stdout.write(linebreak and (s + '\n') or s)
 	sys.stdout.flush()